1
votes

http://imgur.com/6gbxepS

I've been trying to build my Unity game to iOS with Admob, Unity IAP, and Firebase Analytics.

  • Unity Version: 5.6.2f1 Personal
  • Xcode Version: 8.3.3

Steps I've completed:

  1. Enabled IAP and Analytics in Unity Service tab, Imported IAP package
  2. Imported Firebase Analytics Package
  3. Imported Admob unity package
  4. Created new Firebase project in the web portal. Downloaded GoogleService-Info.plist file
  5. Put .plist file in Assets folder.
  6. Ensured my player settings in Unity were correctly configured (Bundle Identifier, Version, IL2CPP set, Architecture: Universal, Device SDK set).
  7. Made Xcode project folder (Release mode set in build settings). Build succeeded, no errors.
  8. Opened terminal window and ran "pod init" in Xcode project folder root
  9. Ran "pod 'Firebase/Core'", "pod install". Succeeded
  10. Opened the .xcworkspace file from Xcode
  11. Changed "Enable Modules (C and Objective-C)" to "Yes" in Build Settings for both target and project files.
  12. Downloaded the GoogleMobileAds.framework (from the GoogleMobileAdsSDK zip)
  13. Added the GoogleMobileAds.framework to the list of frameworks in "Build Phases"
  14. Added AdSupport.framework
  15. Added "-ObjC" to "Other Linker Flags" in both Target and Project files.
  16. Cleaned Project
  17. Build Project, Build failed due to linker errors

I've also tried upping the deployment target to 8.0 rather than 6.0 in the general settings and PodFile, but it didn't remove the errors.

Any help would be appreciated. I think I'm just missing a step somewhere in the Xcode configuration but I can't seem to figure it out.

1
This looks very similar to stackoverflow.com/questions/38599154/…. Maybe that solution will work for you. - Josh Peterson

1 Answers

0
votes

Fixed it! It was a simple mistake on my part. I downloaded an unofficial Google Admob Unity package. This created an "AdmobAPI" folder in my Assets/Plugins which contained the files causing the linker errors.

I didn't notice it right away because this folder was never getting overwritten when I reimported the official packages. It finally caught my eye when I was comparing the directories between my project and Google's sample project which I installed the official packages to.

So in short, double check what you're importing and scan your directories thoroughly if you run into build errors. At this point in time, little to no modification should be needed in Xcode (I didn't need any of those extra steps); Unity does nearly all the work.