Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

xCode can't find UnityAds.h

Discussion in 'Unity Ads & User Acquisition' started by Kyle Kim, Feb 14, 2015.

  1. Kyle Kim

    Kyle Kim

    Joined:
    Dec 3, 2014
    Posts:
    2
    Hello,

    I published Android game with UnityAd. It works well.
    and I tested sample project on iOS with UnityAds unity plugin from Asset store.
    so It was no problem with my iOS device with sample project and UnityAd.

    btw After applied my project, I tried iOS build but xCode couldnot find UnityAds.h

    It seems already UnityAds framework and bundle in xCodeproject.

    I am a newbie on Xcode so didn't know how to solve this problem.
    When I tested sample project. I didn't change or put any option in xCode setting for UnityAds.

    if I tried copy UnityAds.h to library folder or root folder of UnityAds, xCode show linker error like -mach..

    What did I wrong?

    I using iMac and Unity 4.6.2, xCode (newest one)
     
  2. mike950

    mike950

    Joined:
    Sep 30, 2012
    Posts:
    94
    same here
     
  3. Salazar

    Salazar

    Joined:
    Sep 2, 2013
    Posts:
    235
    Hello,

    Did you try to re import the plugin after changing your platform.

    Regards,
     
    mike950 likes this.
  4. Mishaps

    Mishaps

    Joined:
    Nov 28, 2011
    Posts:
    181
    I'm getting the same issue Xcode failing saying:
    .../Xcode/Libraries/UnityAdsUnityWrapper.h:7:9: 'UnityAds/UnityAds.h' file not found

    Even happens in a blank project with just Unity Ads plugin.

    Unity Ads v1.0.4. Unity 4.6.2p2. Bug Report #672455


    With the latest unity update the error in the unity console has more info now:

    KeyNotFoundException: The given key was not present in the dictionary.
    System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (.TKey key) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
    UnityEngine.Advertisements.XCodeEditor.XCProject..ctor (System.String filePath) (at Assets/Standard Assets/Editor/UnityAds/XCodeEditor/XCProject.cs:93)
    UnityEngine.Advertisements.UnityAdsPostprocessor.ProcessXCodeProject (System.String path) (at Assets/Standard Assets/Editor/UnityAds/Scripts/UnityAdsPostprocessor.cs:43)
    UnityEngine.Advertisements.UnityAdsPostprocessor.PostProcessBuild_iOS (System.String path) (at Assets/Standard Assets/Editor/UnityAds/Scripts/UnityAdsPostprocessor.cs:38)
    UnityEngine.Advertisements.UnityAdsPostprocessor.OnPostProcessBuild (BuildTarget target, System.String path) (at Assets/Standard Assets/Editor/UnityAds/Scripts/UnityAdsPostprocessor.cs:22)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
     
  5. mike950

    mike950

    Joined:
    Sep 30, 2012
    Posts:
    94
    Last edited: Feb 15, 2015
    Salazar likes this.
  6. scbundy

    scbundy

    Joined:
    May 23, 2014
    Posts:
    51
    Did you ever solve this mike?
     
  7. mike950

    mike950

    Joined:
    Sep 30, 2012
    Posts:
    94
    Yeah the link helped. And the other errors were just project specific to me.
    It's been a while though so I'm sure by now those problems are fixed.
     
  8. DanglingNeuron

    DanglingNeuron

    Joined:
    Dec 4, 2012
    Posts:
    37
    I got this issue resolved by removing admb plugin from iOS build. Somehow admob plugin is in conflict with UnityAds
     
    unity-nikkolai likes this.
  9. IvyKun

    IvyKun

    Joined:
    Sep 28, 2013
    Posts:
    131
    For me, I still had the problem after removing admob from iOS.

    What I did was delete UnityAds.framework from the UnityAds folder in Xcode and then add it again and it solved it.
     
  10. pokeking

    pokeking

    Joined:
    May 13, 2015
    Posts:
    42
    Did you tried it on Unity 5?
    Or import StoreKit.framework, AdSupport.framework and CoreTelephony.framework to Framework
     
  11. Lion-Jin

    Lion-Jin

    Joined:
    Jul 7, 2009
    Posts:
    32
    I have the same issue when using Unity5.3.3f1, but seems Unity5.3.3P2 solved this problem.