Unity3D admob project on iOS does not compile: a solution
While working on our first game I had to implement for the first time ads in an app. After some searches on the web I found Admob was one of the most easy and complete SDKs to use. You just need to import this custom package and that’s it. Except that…wait. It does not compile on iOS 😱
The error’s from clang and family are really scary but I am here to save your day! Here’s a step-by-step tutorial to follow in order to solve this issue.
First of all open the workspace.
Try to compile if you are feeling lucky, but I suspect that if you are here there’s a reason. It shouldn’t work.
To fix the issues there are two steps to follow:
- In “build setting” of the whole project enable C and C++ modules.
- Download the Admob idk for iOS (https://firebase.google.com/docs/admob/ios/download). Then drag and drop the .framework file into your project’s framework folder
- Third extra step: compile and smile!
Conclusion: this is the easiest way I found to fix the issue. Probably there are better ways like using given cocoapods setup correctly, but when you are working sometimes deadlines are not negotiable, so this is my best solution.