swiftcocoapodsgoogle-imaadmobxcode8.2

Obscure issue, Google AdMob SDK, XCode 8.2 + Cocoapods integration


I have come across a really strange issue that has kept me busy for over a week which i believe to be a bug with the GoogleAdMob SDK, Xcode 8.2, cocoapods or a combination of those.

I am posting it here, in hopes an engineer can confirm the bug and point our team in the right direction to resolution.

The problem goes like this:

  1. Create an empty Xcode project
  2. Add/Install GoogleAds-IMA-iOS-SDK-For-AdMob pod
  3. Commit everything and delete the repository from local machine
  4. Check out repository again
  5. Hit Build. Project will fail to build with error ld: framework not found GoogleMobileAds
  6. To fix, comment out the GoogleAds-IMA-iOS-SDK-For-AdMob pod and run pod update, then uncomment it again and run pod update again, project will build.
  7. If you try to commit at this point, git will pick up no changes
  8. Repeat steps 3 and 4, and you will be back at step 5

I have created a repository here https://github.com/piterwilson/testAdmob where the bug can be reproduced.

The 'fix' that i have found will not work for our team as we commit our code and send it to a Jenkins server that creates a lot of builds with different code signatures required by our business.

The Jenkins build always fails with ld: framework not found GoogleMobileAds

Extra information : This has only happened starting this year. Maybe because of Xcode 8.2 (?) but we can't be sure where the problem is exactly.


Solution

  • I created a PR that resolves the issue in a reliable manner: https://github.com/piterwilson/testAdmob/pull/1

    The repository was missing the GoogleAdMobs binary. It's a rather large file (38M), so perhaps the submitter of the question has some local configuration that automatically ignores large files? The binary should have been in this commit: https://github.com/piterwilson/testAdmob/commit/a0834a4d2f2b82da98add1bc3c49d8c0c28ffd86 (at least that's when it appeared for me when I tried to reproduce the issue.)