Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by GabLeRoux · Nov 12, 2016 at 09:57 PM · iosbuildxcodeadmoblinker

ios xcode 8 build error with google adbmob, GADMAdapterAdColony, ld: symbol(s) not found for architecture arm64

Hi folks,
I'm trying to integrate some Rewarded video ads using GoogleAdMob unity plugin. I managed to make the sample work for android by using MAD Reward Mediation sample app, shared somewhere in a google group. Anyway, I was able to build for android and the reward videos are working for AdColony, Chartboost and Unity Ads, but I cannot build it for iOS.

I went on the firebase admob/ios/mediation-networks page and grabbed the ios Adapters for AdColony, Chartboost and Unity Ads, added them to Plugins/iOS/ in my project. I though it was failing to build because of a missing linked AdSupport.framework so I made sure it was checked in Framework dependencies (it was). I manually added it to the Xcode build too, but it still fails.

Here's the error I get:

 ld: warning: arm64 function not 4-byte aligned: ltmp0 from PATH_TO_IOS_BUILD/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
 ld: warning: arm64 function not 4-byte aligned: _unwind_tester from PATH_TO_IOS_BUILD/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
 Undefined symbols for architecture arm64:
   "_OBJC_CLASS_$_AdColony", referenced from:
       objc-class-ref in libAdapterSDKAdColony.a(GADMAdapterAdColony.o)
       objc-class-ref in libAdapterSDKAdColony.a(GADMAdapterAdColonyInitializer.o)
   "_OBJC_CLASS_$_Chartboost", referenced from:
       objc-class-ref in libAdapterChartboostAds.a(GADMAdapterChartboostSingleton.o)
       objc-class-ref in libAdapterChartboostAds.a(GADMAdapterChartboost.o)
   "_ADC_SET_USER_GENDER", referenced from:
       -[GADMAdapterAdColony addUserMetadata] in libAdapterSDKAdColony.a(GADMAdapterAdColony.o)
   "_ADC_USER_MALE", referenced from:
       -[GADMAdapterAdColony addUserMetadata] in libAdapterSDKAdColony.a(GADMAdapterAdColony.o)
   "_ADC_SET_USER_LATITUDE", referenced from:
       -[GADMAdapterAdColony addUserMetadata] in libAdapterSDKAdColony.a(GADMAdapterAdColony.o)
   "_ADC_USER_FEMALE", referenced from:
       -[GADMAdapterAdColony addUserMetadata] in libAdapterSDKAdColony.a(GADMAdapterAdColony.o)
   "_ADC_SET_USER_AGE", referenced from:
       -[GADMAdapterAdColony addUserMetadata] in libAdapterSDKAdColony.a(GADMAdapterAdColony.o)
   "_CBLocationDefault", referenced from:
       -[GADMAdapterChartboost setUp] in libAdapterChartboostAds.a(GADMAdapterChartboost.o)
       -[GADMAdapterChartboost requestRewardBasedVideoAd] in libAdapterChartboostAds.a(GADMAdapterChartboost.o)
       -[GADMAdapterChartboost getInterstitial] in libAdapterChartboostAds.a(GADMAdapterChartboost.o)
   "_ADC_SET_USER_LONGITUDE", referenced from:
       -[GADMAdapterAdColony addUserMetadata] in libAdapterSDKAdColony.a(GADMAdapterAdColony.o)
 ld: symbol(s) not found for architecture arm64
 clang: error: linker command failed with exit code 1 (use -v to see invocation)
 Showing first 200 warnings only

I'm building with Xcode Version 8.1 (8B62). My build architectures are armv7, arm64. I do have $(inherited) flag in Other Linker Flag like in this undefined-symbols-for-architecture-arm64 StackOverflow question.

This is what I have in my Podfile:

 target 'Unity-iPhone' do
     pod 'GooglePlayGames', '5.1'
     pod 'Google-Mobile-Ads-SDK', '~> 7.8'
     pod 'GoogleSignIn', '~> 2.2.0'
 end

Without the added adapters, it does build, but it fails to display the ads. I'll try to isolate the problem in a separate project to see if it's related to something else than the ads adapters.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by JRobichaud · Nov 16, 2016 at 07:40 PM

Add AdMob Library in the Xcode project. You included only the AdMob Adapter Library.

You can validate if an architecture is available in a library using the unix command "file".

I ran "file" on the adapters an I confirm they are arm64.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by GabLeRoux · Nov 17, 2016 at 05:41 AM

Thanks @jrobichaud, that was indeed the cause of the errors concerning "_OBJC_CLASS_$_AdColony" and "_OBJC_CLASS_$_Chartboost"

I didn't like the idea of manually adding .framework files to the xcode project so I used cocoapod to install the SDKs.

I was able to compile by adding the following to my Pofile:

 target 'Unity-iPhone' do
     pod 'GooglePlayGames', '5.1'
     pod 'Google-Mobile-Ads-SDK', '~> 7.8'
     pod 'GoogleSignIn', '~> 2.2.0'
     pod 'UnityAds', '~> 1.5'
     pod 'AdColony', '~> 2.6.2'
     pod 'ChartboostSDK', '~> 6.5'
 end

I first tried with pod 'AdColony', '~> 3.0.0', but it was failing with the same

 "_ADC_SET_USER_GENDER", referenced from:
    -[GADMAdapterAdColony addUserMetadata] in libAdapterSDKAdColony.a(GADMAdapterAdColony.o)
 "_ADC_USER_MALE", referenced from:
    -[GADMAdapterAdColony addUserMetadata] in libAdapterSDKAdColony.a(GADMAdapterAdColony.o)
 "_ADC_SET_USER_LATITUDE", referenced from:
    -[GADMAdapterAdColony addUserMetadata] in libAdapterSDKAdColony.a(GADMAdapterAdColony.o)
 "_ADC_USER_FEMALE", referenced from:
    -[GADMAdapterAdColony addUserMetadata] in libAdapterSDKAdColony.a(GADMAdapterAdColony.o)
 "_ADC_SET_USER_AGE", referenced from:
    -[GADMAdapterAdColony addUserMetadata] in libAdapterSDKAdColony.a(GADMAdapterAdColony.o)
 "_CBLocationDefault", referenced from:
    -[GADMAdapterChartboost setUp] in libAdapterChartboostAds.a(GADMAdapterChartboost.o)
    -[GADMAdapterChartboost requestRewardBasedVideoAd] in libAdapterChartboostAds.a(GADMAdapterChartboost.o)
    -[GADMAdapterChartboost getInterstitial] in libAdapterChartboostAds.a(GADMAdapterChartboost.o)
 "_ADC_SET_USER_LONGITUDE", referenced from:
    -[GADMAdapterAdColony addUserMetadata] in libAdapterSDKAdColony.a(GADMAdapterAdColony.o)

I found this obscure post which basically says to use 2.6.2 which allowed me to compile :)

Sadly, the same code that works on Android is failing on ios when it comes to loading the rewardbased video in the background. (app crashes), also crashes after showing an Interstitial. Cool thing is I have a clear message in xcode console now:

 <Google> Cannot find an ad network adapter with the name(s): GADMAdapterUnity. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.
 HandleRewardBasedVideoFailedToLoad event received with message: Failed to receive ad with error: No ad returned from any ad server.
 GoogleMobileAdsController:HandleRewardBasedVideoFailedToLoad(Object, AdFailedToLoadEventArgs)
  
 (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

 libc++abi.dylib: terminating with uncaught exception of type Il2CppExceptionWrapper

I suppose that even tho the app succeeds to build and that the SDKs are installed with cocoapod, I probably have to link them somehow.

There is this post that has a similar error and it would be that the sdk isn't correctly linked (I suppose it's the case).

I tried on a blank project (faster to build). Turned out that there are many things that needs to be done manually (sadly).

I had the following error:

ld: library not found for -liPhone-lib

The cocoapod version of the UnityAds is too old. Solution, manually grab the 2.0.x version as described in the instructions and link it manually (seriously I mean 2016 and we're still doing drag n drop shits?) According to the readme of the UnityAds adapter, it requires Unity Ads SDK to v2.0.4 and the cocoapod version installs 1.5 so remove that and link the framework file. Worked for me this time and I saw ads from each of the providers.

tldr; read integration readmes, cocoapods is cool, but may bot work for every integrations, better to test one after the other for easier debugging.

March 2017 edit AdColony removed 2.6.2 version and I can't build anymore. Installing using latest version could solve the problem:

 pod 'AdColony', '~> 3.1'

but I'm still fighting with it, I may have to update the Adapter too.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

78 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can I modify codes using Xcode after creating the app using Unity3d? 1 Answer

How to add Google Admob SDK for iOS in Unity editor (instead to do it manually in XCode)? 0 Answers

How to get readable stacktrace in IOS build? 1 Answer

IOS conversion Xcode not launching 0 Answers

Unity iOS build error 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges