Search Unity

Google AdMob not working when building for iOS?

Discussion in 'iOS and tvOS' started by jbjbjbborisb, Sep 21, 2014.

  1. jbjbjbborisb

    jbjbjbborisb

    Joined:
    Jun 8, 2014
    Posts:
    54
    I added the Google AdMob Plugin to my Unity game.
    On Android the game runs fine and all banners show up. But when Creating the Xcode project for iOS, it wont build:

    Errors:
    GADURequest.h:5:9: 'GADRequest.h' file not found
    GADUBanner.m:9:9: 'GADAdMobExtras.h' file not found

    Is this a problem with Unity or the Google AdMob SDK? What's the trick to make this work?
    BTW: Those files don't exist anywhere in the AdMob plugin for Unity...
     
  2. Triggles

    Triggles

    Joined:
    Aug 23, 2014
    Posts:
    30
  3. jbjbjbborisb

    jbjbjbborisb

    Joined:
    Jun 8, 2014
    Posts:
    54
    Yeah, I tried that. That fixed the missing header errors but got me drowning in linker errors. So far I haven't able to fix those...
     
  4. Triggles

    Triggles

    Joined:
    Aug 23, 2014
    Posts:
    30
    I'll be testing out my admob project on iOS this week so I'll let you know how it goes.
     
  5. jbjbjbborisb

    jbjbjbborisb

    Joined:
    Jun 8, 2014
    Posts:
    54
    That would be great. Thanks a lot!
     
  6. Triggles

    Triggles

    Joined:
    Aug 23, 2014
    Posts:
    30
  7. jbjbjbborisb

    jbjbjbborisb

    Joined:
    Jun 8, 2014
    Posts:
    54
    These are the errors:

    Undefined symbols for architecture armv7:
    "_OBJC_CLASS_$_EKEvent", referenced from:
    objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
    "_OBJC_CLASS_$_EKEventEditViewController", referenced from:
    objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    I'm not sure what to make of those. Looks like EventKit (?). But that's not required by Google...
     
  8. Triggles

    Triggles

    Joined:
    Aug 23, 2014
    Posts:
    30
    I guess try adding eventkit and eventkitui

    Although I don't think I did. I'll check next time I'm near the Mac.
     
    jbjbjbborisb likes this.
  9. jbjbjbborisb

    jbjbjbborisb

    Joined:
    Jun 8, 2014
    Posts:
    54
    Boom, nailed it :-D

    I don't know why Google docs did not mention that, but this fixed it.
    Thanks a bunch, mate!
     
  10. Triggles

    Triggles

    Joined:
    Aug 23, 2014
    Posts:
    30
    I definitely didn't add those, so something else must have. How odd. Oh well, I'm glad it's fixed!
     
  11. iPanda

    iPanda

    Joined:
    Dec 21, 2014
    Posts:
    1
  12. leewang2502

    leewang2502

    Joined:
    Jan 19, 2015
    Posts:
    8
    Dear all,

    I have add all lib required but still had the problem: "GADRequest.h file not found."
    Could you please help me in this issue?

    Thanks so much!!!

     
  13. cybervaldez

    cybervaldez

    Joined:
    Aug 16, 2014
    Posts:
    87
    It took me a lot of time making this work as well so I've made some notes, let me share it with everyone:
    1. Download the GoogleMobileAdsSdkiOS-6.12.2 instead of the new 7.0 one, after extracting right click on your project in XCode -> Add to Files ... -> Select the GoogleMobileAdsSdkiOS-6.12.2 folder (Tick Copy items as needed)
    2. Download and include the GooglePlayGames.bundle and gpg.framework from the gpg-cpp-sdk (C++ SDK) and not the ones found in GooglePlayGames-iOS-SDK.*
    3. Include the Libraries mentioned in step 3 here:
    https://developers.google.com/mobil...s/quick-start#manually_using_the_sdk_download
    4. Make sure target development is ios7.0
    5. Add to Linked Libraries
    - GoogleMobileAdsSdkiOS-6.12.2/libGoogleAdMobAds.a
    - GoogleOpenSource.framework
    - GooglePlus.bundle
    - GooglePlus.framework
    - GooglePlayGames.bundle
    - gpg.framework
    6. Add the following to Copy Bundle Resources:
    - GooglePlayGames.bundle
    - GooglePlus.bundle
    7. Add -ObjC to Linker Flags
    8. Build

    Edit: Please note that this is my setup when i'm using both Admob and Google Play.
     
    Last edited: Feb 6, 2015
    leewang2502 likes this.
  14. leewang2502

    leewang2502

    Joined:
    Jan 19, 2015
    Posts:
    8
    Thanks for this
    But could you please give me the link to download GoogleMobileAdsSdkiOS-6.12.2? I couldnt find it anywhere to download

    Thanks in advanced
     
  15. cybervaldez

    cybervaldez

    Joined:
    Aug 16, 2014
    Posts:
    87
  16. pepin_the_healer666

    pepin_the_healer666

    Joined:
    Feb 9, 2015
    Posts:
    5
    Current version of Unity Plugin seems to be not compatible with new version (7.0) of google's mobile ads ios sdk released on 2015-02-03. You can see in the release notes (https://developers.google.com/mobile-ads-sdk/rel-notes#ios) that one of the points is:
    "Replaced GADAdMobExtras and DFPExtras with a single GADExtras class.".
    That's the reason for GADAdMobExtras.h file not found error.

    cybervaldez's solution works (and thanks for that bro), but it's more like a workaround since it relies on downgrading version of library.
    Real solution would be updating Unity Plugin to work with version 7.0 of googles mobile ads sdk, but as far as i know such update is not yet available.
     
    Jaxily likes this.
  17. mided

    mided

    Joined:
    Mar 26, 2014
    Posts:
    2
  18. bratila.razvan

    bratila.razvan

    Joined:
    Oct 17, 2013
    Posts:
    1
    i have this monstrosity! Xcode 6.1.1, unity 4.6.2, latest Admob plugins, (all the) frameworks, librarys, sdk's ...
    Screen Shot 2015-03-02 at 16.35.57.png

    Thanks for any help provided.
     
  19. Jaxily

    Jaxily

    Joined:
    Jul 17, 2014
    Posts:
    16
    Does anyone know when the Unity Plugin will work with version 7.0 of googles mobile ads sdk
     
  20. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,049
    I found similar issue using latest admob plugin sdk version 7.0. I have uploaded image that demonstrate some what my xcode log details.

    If I change my admob sdk version to 6.9.2 then it works perfectly on same project.

    I am using Unity 4.5.5p3 version to create for xCode build. Also I have used xCode 6.1 installed.
    I have tried above all post content in my project but didn't get success in that.

    Please give some suggestion where I was doing wrong.
     

    Attached Files:

  21. CyberTurboPlays

    CyberTurboPlays

    Joined:
    Nov 7, 2014
    Posts:
    65
    did you know they updated admob unity plug to v2.2 over at git like yesterday?

    its so funny when i spend a night try to fix the admob wouldnt go with sdk7 problem, then when i finally fixed it to work with sdk 7(some work around from net) and submit my build yesterday, i found out they hav finally updated the unity admob plugin to go with sdk 7, what a waste of my night!!
     
  22. joneman

    joneman

    Joined:
    Mar 5, 2016
    Posts:
    8


    You need add frameworks of all in this list
    https://github.com/unity-plugins/Unity-Admob#important-tips
     
  23. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    Please also make sure that you have either -ObjC or -all_load in the linker flags.
     
  24. avi9111

    avi9111

    Joined:
    Feb 24, 2016
    Posts:
    31
    i count on this issue, no link error ,no armv7 error ,just simple
    "GADAdMobExtras.h" no file found
    could you please don's say other problem and solution, I scared
     
  25. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    It looks like one of your plugins is broken, please contact plugin vendor.
     
  26. ourangzaibkhan

    ourangzaibkhan

    Joined:
    Jul 12, 2013
    Posts:
    2