'How do i solve "Undefined symbols for architecture arm64" error?
I used the latest version of the AdMob plugin & unity Mediation plugin. but I still get this error, How do I solve the "Undefined symbols for architecture arm64" error?. Please help me to solve this error.
Here is my pod file look like:
source 'https://github.com/CocoaPods/Specs' source 'https://github.com/CocoaPods/Specs.git' platform :ios, '12.0'
target 'UnityFramework' do pod 'GoogleMobileAdsMediationUnity', '4.0.1.0' pod 'Google-Mobile-Ads-SDK', '~> 9.0' end target 'Unity-iPhone' do end use_frameworks!
Errors that got from Xcode:
Undefined symbols for architecture arm64: "_GADAdSizeLeaderboard", referenced from: _supportedAdSizeFromRequestedSize in UnityAdapter(GADMAdapterUnityUtils.o) "_NSValueFromGADAdSize", referenced from: _supportedAdSizeFromRequestedSize in UnityAdapter(GADMAdapterUnityUtils.o) "_NSStringFromGADAdSize", referenced from: +[NSError(Unity) unsupportedBannerGADAdSize:] in UnityAdapter(NSErrorUnity.o) "OBJC_CLASS$_GADMediationAdConfiguration", referenced from: _OBJC$CATEGORY_GADMediationAdConfiguration$_Settings in UnityAdapter(GADMediationConfigurationSettings.o) "OBJC_CLASS$_GADMediationServerConfiguration", referenced from: _OBJC$CATEGORY_GADMediationServerConfiguration$_Settings in UnityAdapter(GADMediationConfigurationSettings.o) "_GADAdSizeBanner", referenced from: _supportedAdSizeFromRequestedSize in UnityAdapter(GADMAdapterUnityUtils.o) "_GADClosestValidSizeForAdSizes", referenced from: _supportedAdSizeFromRequestedSize in UnityAdapter(GADMAdapterUnityUtils.o) "_IsGADAdSizeValid", referenced from: -[GADMediationAdapterUnity loadBannerForAdConfiguration:completionHandler:] in UnityAdapter(GADMediationAdapterUnity.o) -[GADMAdapterUnity getBannerWithSize:] in UnityAdapter(GADMAdapterUnity.o) "OBJC_CLASS$_GADAdReward", referenced from: objc-class-ref in UnityAdapter(GADMUnityRewardedMediationAdapterProxy.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Solution 1:[1]
After you generate Xcode project files from unity, pod file like this:
source 'https://github.com/CocoaPods/Specs'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'
target 'UnityFramework' do
pod 'GoogleMobileAdsMediationUnity', '3.7.1.0'
pod 'Google-Mobile-Ads-SDK', '~> 8.8'
end
target 'Unity-iPhone' do
end
use_frameworks!
You need to add these lines on aswell
so must be like these
"target 'Unity-iPhone' do"
source 'https://github.com/CocoaPods/Specs'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'
target 'UnityFramework' do
pod 'GoogleMobileAdsMediationUnity', '3.7.1.0'
pod 'Google-Mobile-Ads-SDK', '~> 8.8'
end
target 'Unity-iPhone' do
pod 'GoogleMobileAdsMediationUnity', '3.7.1.0'
pod 'Google-Mobile-Ads-SDK', '~> 8.8'
end
use_frameworks!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Ucdemir |