Unity iOS build containing Admob causes error in Xcode - ios

My project uses Admob to display ads. It works on Android but not on iOS. Build with Xcode is successful. When running the app in Xcode on simulator, I get the following runtime error:
Symbol not found: OBJC_CLASS$_GADInterstitialAd
Used the latest versions of:
external-dependency-manager-1.2.175.unitypackage
GoogleMobileAds-v7.4.0.unitypackage
Unity 2021.3.18f1
Xcode Version 12.4 (12D4e)
Contents of Assets/ExternalDependencyManager/Editor/1.2.175/AdMob_Dependencies.xml include iOS configuration:
<!-- iOS Cocoapod dependencies can be specified by each iosPod element. -->
<iosPods>
<iosPod name="Google-Mobile-Ads-SDK" version="~> 7.4" bitcodeEnabled="true"
minTargetSdk="14.0" addToAllTargets="false" />
<!-- Set of source URIs to search for this Cocoapod spec.
By default Cocoapods will attempt to fetch the pod specs from:
* $HOME/.cocoapods/repos
* https://github.com/CocoaPods/Specs
-->
<sources>
<source>https://github.com/CocoaPods/Specs</source>
</sources>
</iosPods>
I tried all versions of GoogleMobileAds from v7.0 to v7.4 unsuccessfully.

Related

Grpc.Core.Xamarin giving object file was built for newer iOS Simulator version (9.0) than being linked (8.0)

I am trying to build a gRPC client for mobile using Xamarin.Forms and Grpc.Core and Grpc.Core.Xamarin. Everything is currently working for Android, however my iOS project will not build. I get a little over 100 errors (and 1000 warnings) stating "warning: object file (C:/Users/Matt/.nuget/packages/grpc.core.xamarin/2.41.1/build/Xamarin.iOS10/../../native/ios/universal/libgrpc.a(server_address.o)) was built for newer iOS Simulator version (9.0) than being linked (8.0)"
Now the iOS .csproj file does indeed show the version of my simulator is 8
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{AA8D5164-21F8-4A44-96F9-A8D3E0021486}</ProjectGuid>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TemplateGuid>{89a4fe7c-635d-49c9-8d8c-5cd363c0d68d}</TemplateGuid>
<OutputType>Exe</OutputType>
<RootNamespace>myProject.iOS</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>myProject.iOS</AssemblyName>
<MtouchEnableSGenConc>true</MtouchEnableSGenConc>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<ProvisioningType>manual</ProvisioningType>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
As you can see above the version is 8.0.30703. I cannot however seem to find any information on how to update my simulator to version 9.0.
Any and all help is appreciated, I'm sure I'm just missing something simple.
As Cahyo mentioned, the solution was in my info.plist file. Just needed to change my deployment target from 8.0 to 9.0 or above.

PhoneGap Build Failing for iOS though It Works for Android Fine

I tried to run the Adobe PhoneGap build for a hybrid App. It worked fine for Android but failed for iOS though everything was working OK earlier. I have updated the phonegap-version as the following:
<preference name='phonegap-version' value='cli-8.0.0' />
The error log shows the following:
copy splash.png ../../../../private/project/www/splash.png (new file)
TypeError: Cannot read property 'indexOf' of null
at parseWhitelistUrlForATS (/private/project/cordova/lib/prepare.js:1038:26)
at /private/project/cordova/lib/prepare.js:965:23
at Array.reduce (native)
at processAccessAndAllowNavigationEntries (/private/project/cordova/lib/prepare.js:956:10)
at writeATSEntries (/private/project/cordova/lib/prepare.js:1081:16)
at updateProject (/private/project/cordova/lib/prepare.js:217:15)
at /private/project/cordova/lib/prepare.js:59:20
at _fulfilled (/private/project/cordova/node_modules/q/q.js:854:54)
at self.promiseDispatch.done (/private/project/cordova/node_modules/q/q.js:883:30)
at Promise.promise.promiseDispatch (/private/project/cordova/node_modules/q/q.js:816:13)
before ending. Please help.
I just changed the CLI version to cli-6.5.0
<preference name='phonegap-version' value='cli-6.5.0' />
and it worked. It looks higher version creates issues.

ANE Packaging with IOS11

i have devloped an ANE that connects to a bluetooth printer in order to print ,this ane was working perfectly until IOS 11 has been publish
now what i see in the log is that the printer connects but cant print
i updated the xCode to support ios 11 and updates the air to 27 and compiled the new ane and the swc also compiled in air 27
now when i try to publish the app i got this msg "
Error occurred while packaging the application:
Error: META-INF/ANE/iPhone-ARM/libCoreMobileAPI.a,
META-INF/ANE/iPhone-ARM/libZebraChecker.a are required to have
universal iOS libraries. Please contact the ANE developer(s) to get
the same."
This ANE works only for IOS
iam sure that i have chosen universal iOS when i build the .a file
anyone has solution or can give me hints what to do
thanks
Descriptor XML
<?xml version="1.0" encoding="UTF-8"?>
<extension xmlns="http://ns.adobe.com/air/extension/27.0">
<id>BlCheck.ZebraAneBLCheck</id>
<versionNumber>1.0.0</versionNumber>
<platforms>
<platform name="iPhone-ARM">
<applicationDeployment>
<nativeLibrary>libZebraChecker.a</nativeLibrary>
<initializer>cubecomDoitflashZebraPrinterExtensionInitializer</initializer>
<finalizer>cubecomDoitflashZebraPrinterExtensionFinalizer</finalizer>
</applicationDeployment>
</platform>
<platform name="default">
<applicationDeployment/>
</platform>
</platforms>
</extension>
In Architectures settings of your target make sure you have your settings as below. Important parts are the "Valid Architectures" and the "Build Active Architecture Only" settings.
If that doesn't work make sure that you are using the correct .a file. You can run the following command on the .a file:
file libZebraChecker.a
It should output something like the following if it is a universal binary:
libZebraChecker.a: Mach-O universal binary with 2 architectures: [arm_v7: current ar archive] [arm64: current ar archive]
libZebraChecker.a (for architecture armv7): current ar archive
libZebraChecker.a (for architecture arm64): current ar archive

Xamarin.iOS Error: The Apple iOS SDK is not installed. (iOS9, XCode 7 beta)

I have installed XCode 7 beta, Xamarin.iOS 8.99.4 and Xamarin Studio 5.9 on Mac OSX 10.10.5.
I refer this article. https://developer.xamarin.com/guides/ios/platform_features/introduction_to_ios9/ .
If I debug/run a Xamarin.iOS app on iOS Simulator (iOS9), it works well.
But when I debug/run it on my iPhone5s device (iOS9), Xamarin shows this error message.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: Error: The Apple iOS SDK is not installed. (ex33.iOS)
The "Build Output" window show following message.
__________________________________________________
Project "/Users/username/Projects/ex33/iOS/ex33.iOS.csproj" (Build target(s)):
Target PrepareForBuild:
Configuration: Debug Platform: iPhone
Target _DetectAppManifest:
FindItemWithLogicalName Task
Items:
Info.plist
Entitlements.plist
packages.config
LogicalName: Info.plist
ProjectDir: /Users/username/Projects/ex33/iOS
ResourcePrefix: Resources
Target _DetectSdkLocations:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: error : The Apple iOS SDK is not installed.
DetectSdkLocations Task
TargetFrameworkIdentifier: Xamarin.iOS
TargetArchitectures: ARMv7, ARM64
SdkVersion: <null>
XamarinSdkRoot: /Library/Frameworks/Xamarin.iOS.framework/Versions/Current
SdkRoot: <null>
SdkDevPath: /Applications/Xcode-beta.app/Contents/Developer
SdkUsrPath: <null>
SdkPlatform: <null>
SdkIsSimulator: False
Task "DetectSdkLocations" execution -- FAILED
Done building target "_DetectSdkLocations" in project "/Users/username/Projects/ex33/iOS/ex33.iOS.csproj".-- FAILED
Done building project "/Users/username/Projects/ex33/iOS/ex33.iOS.csproj".-- FAILED
Build FAILED.
Errors:
/Users/username/Projects/ex33/iOS/ex33.iOS.csproj (Build) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets (_DetectSdkLocations target) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: error : The Apple iOS SDK is not installed.
0 Warning(s)
1 Error(s)
---------------------- Done ----------------------
What can I do?
P.S. When I debug/run a app in XCode 7 beta, it works on my iPhone well.
Check the preferences in Xamarin Studio.. you may need to change the Apple SDK path to point to the Beta location.
By default, it should be looking in the default location, but that will only be present if you have the General Release (non Beta) Xcode and iOS SDK installed too.

Cannot find lib when packaging for iOS

for numbers in (), see links at the end
I am developping an Air Native Extension (ANE) in order to be able to use the burstly ads on mobile devices.
As for my setup, I am using the FlashDevelop 4.0.4 and Adobe Air 3.3. I'm using Flex 4.6.0 SDK. The project is setup on Windows7.
In order to work on iOS devices, Burstly requires a number of frameworks and librares
I managed to write and compile the .a library for iOS. I also have the interface (actionscript code) that will be shared for Android and iOS compiled into a swc and a librairy.swf. All of this is successfully packaged into a .ane which is included in my project.
When compiling a .a library on MacOS, all the framework and library used don't seems to be packaged in the ".a". This is why I had to use Air 3.3, for the -platformsdk option(1).
Since I work on Windows, I followed the instruction in this post to get the iOS SDK (2).
Following the required framework and (1), I made a platformConfig.xml file like this, which is packaged in the .ane
<platform xmlns="http://ns.adobe.com/air/extension/3.1">
<sdkVersion>4.2</sdkVersion>
<linkerOptions>
<!-- to use the AssetsLibrary framework -->
<option>-framework AssetsLibrary</option>
<option>-framework AudioToolbox</option>
<option>-framework AddressBook</option>
<option>-framework AVFoundation</option>
<option>-framework CFNetwork</option>
<option>-framework CoreLocation</option>
<option>-framework MapKit</option>
<option>-framework MediaPlayer</option>
<option>-framework MessageUI</option>
<option>-framework OpenAL</option>
<option>-framework OpenGLES</option>
<option>-framework QuartzCore</option>
<option>-framework StoreKit</option>
<option>-framework SystemConfiguration</option>
<option>-framework Foundation</option>
<option>-framework CoreGraphics</option>
<option>-libsqlite3</option>
<option>-libxml2</option>
<option>-libz</option>
</linkerOptions>
</platform>
and this is the line to compile the actuale .ane
call "%FLEX_SDK%\bin\adt" -package -target ane ../release/burstlyadsextension.ane extension.xml -swc burstlyAds.swc -platform iPhone-ARM library.swf libBurstlyAds.a -platformoptions platformConfig.xml
Problem arises when I try to package the iOS app with ADT:
call adt -package -target %TYPE%%TARGET% %OPTIONS% %SIGNING_OPTIONS% "%OUTPUT%" "%APP_XML%" %FILE_OR_DIR% -extdir lib/external/ -platformsdk ../Libraries/iPhoneOS5.0.sdk/
this happens:
"ld: library not found for -libsqlite3
Compilation failed while executing : ld64"
frameworks seems to be added fine, but the dylib are not. I tried to add the line:
<option>-L usr/lib/</option>
before including the lib, but I got this error instead:
"ld: warning: directory not found for option '-Lusr/lib/'
ld: library not found for -libsqlite3
Compilation failed while executing : ld64"
I tried to use the full path, other relative path, but no matter what path I put in the option, I always get a "warning: directory not found for option". Even "-L ../" give me this warning. The only thing that seems to work is "-L /../", but my .dylib obviousle are not there.
So my questions are: What did I do wrong? Any idead what else I could try? Even an explanation as to why it is not working would be helpful!
Links:
1: http://blogs.adobe.com/rajorshi/2011/11/16/ios5-support-for-airusing-external-sdks-to-package-apps/
2: http://blogs.adobe.com/airodynamics/2012/05/18/using-platformsdk-for-ios-on-windows/

Resources