Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

UnityAds/UnityAds.h Not Found in Xcode - Unity 5

Discussion in 'Unity Ads & User Acquisition' started by TillmaniaLtd, Mar 15, 2015.

Thread Status:
Not open for further replies.
  1. TillmaniaLtd

    TillmaniaLtd

    Joined:
    Jan 29, 2013
    Posts:
    65
    Hey,

    Just updated to Unity 5 and am having a compile issue in Xcode. Running UnityAds 1.1.2 and Xcode 6.2.

    The compile error is "-/Plugins/iOS/UnityAdsUnityWrapper.h:7:9: 'UnityAds/UnityAds.h' file not found.
     
  2. infosekr

    infosekr

    Joined:
    Jul 12, 2013
    Posts:
    46
    I'm seeing the same thing, any solution yet?
     
  3. Trungdv

    Trungdv

    Joined:
    Dec 1, 2012
    Posts:
    22
    I have same issue. My project has been fine with Unity 4.6, then this problem appear when I upgrade to Unity 5.
     
  4. latas

    latas

    Joined:
    Oct 9, 2013
    Posts:
    149
    I guess it is a bug from Unity. I'm experiencing the same with Unity 4.6.3 so, it is not an issue of Unity 5. It is an issue of Unity Ads update.
    Meanwhile to fix this issue replace the path to <UnityAds/UnityAds.h> with this one:
    <UnityAds/UnityAds.framework/Headers/UnityAds.h>

    Best regards.
     
    kadikov likes this.
  5. scbundy

    scbundy

    Joined:
    May 23, 2014
    Posts:
    51
    I'm getting the same error. I tried changing the path as you said but now I'm just getting "ld: framework not found for UnityAds" under a Apple Mach-O-Linker error
     
  6. scbundy

    scbundy

    Joined:
    May 23, 2014
    Posts:
    51
    Is there any solution to this? I've been banging my head against the wall and I'm not at all proficient with Mac so I can't puzzle my way through this.
     
  7. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Is anyone still getting this error message with the Unity Ads asset package v1.1.4, the latest Unity patch (4.6.4p4 or 5.0.1p3), and the latest version of Xcode v6.3.1?
     
  8. DanglingNeuron

    DanglingNeuron

    Joined:
    Dec 4, 2012
    Posts:
    37
    I am still getting this error latest UnityAds 1.1.4, Xcode 6.3.1 ... but I have Unity 4.6.4f1

    Whats strange that it worked for me yesterday. The only change I can think of is that I tried integrating Admob today. And this error started happening.


    When I change the import address to teh full <UnityAdfs/UnityAds.framework....> Then I get the Match-O Linker error of UnityAd framework not found - even though I see it linked in the project build settings.
     
  9. pilot86131

    pilot86131

    Joined:
    Aug 6, 2014
    Posts:
    3
    Hello! I have some problem too. "-/Plugins/iOS/UnityAdsUnityWrapper.h:7:9: 'UnityAds/UnityAds.h' file not found. I have UnityAds 1.1.4, Xcode 6.3.1, Unity 4.6.4f1 too. I added UnityAds.framework and bundle to xcode. But i cant find DeviceInfo.framework. in SDK from asset store. Please, Help me! My game have 2 millions of downloads!
     

    Attached Files:

    Last edited: May 8, 2015
  10. pilot86131

    pilot86131

    Joined:
    Aug 6, 2014
    Posts:
    3
    In the XCode. Very Need Help!
     

    Attached Files:

  11. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    This is still an ongoing issue. Being that it's difficult to reproduce, I haven't been able to nail down what causes it exactly. However, it does appear to resolve itself after updating to the latest versions of Unity Ads, Unity, and Xcode.

    Please make sure that you're using the latest version of Unity Ads in your project (1.1.4), the latest patch release of Unity (4.6.5p1 or 5.0.1p4), and the latest version of Xcode (6.3.1).

    Also make sure that the Scripting Backend is set to IL2CPP and Architecture is set to Universal under Player Settings in Unity for iOS before building your Xcode project.

    If you have been building your Xcode project from Windows, please build your project from Unity on a Mac instead.

    When asked to save your Xcode project, select the option to Replace instead of Append.

    If you still experience this issue after all of the above, export the contents of your Unity project as an asset package. Then create a new Unity project and import the asset package into the new project.

    If this still doesn't fix the issue, make the asset package available to download by sending me a Dropbox link in a private conversation so I can look over the contents for any potential issues.

    Outside of the above cases, possible causes for this issue under optimal conditions include:
    • Unity Ads assets moved from their original import directories.
    • Legacy Unity Ads build scripts still exist somewhere in the project.
    • Possible conflict with other 3rd party plugins and Unity Ads build scripts.
    I have not been able to reproduce this issue. Any additional info would be helpful.
     
  12. scbundy

    scbundy

    Joined:
    May 23, 2014
    Posts:
    51
    I fixed it in my game by adding the -ObjC into that line in build phases. Looks like if you don't have iTunes installed a couple steps don't get run, and that was one of them.

    Oh and make sure your slashes are correct in your library paths. Unity put a \ in when it should have been a /

    I had to change that too.
     
  13. DanglingNeuron

    DanglingNeuron

    Joined:
    Dec 4, 2012
    Posts:
    37
    Where did you add the -ObjC ? in Xcode somewhere? I am building from windows and then bringing Xcode project to Mac.
     
  14. DanglingNeuron

    DanglingNeuron

    Joined:
    Dec 4, 2012
    Posts:
    37
    OK, so probably what I should have done a week ago ... I created a brand new empty project and added UnityAds.. and viola it does work on iPhone.

    So now, I am going to slowly deconstruct whats wrong with my big ass project.

    UPDATE:
    It looks some kind of conflict with the admob iOS plugin. I am noob in mac/iOS world so cant say whats wrong but admob requires to set YES to "Enable Modules (C and ObjC)" in build settings. and maybe thats whats causing an issue with Unity Ads?
     
    Last edited: May 13, 2015
    unity-nikkolai likes this.
  15. pilot86131

    pilot86131

    Joined:
    Aug 6, 2014
    Posts:
    3
    unity-nikkolai likes this.
  16. IvyKun

    IvyKun

    Joined:
    Sep 28, 2013
    Posts:
    132
    I found a solution (before this I updated UnityAds to the last version and Unity to 4.6.6f2 and the problem was still there)

    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.
     
  17. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    I have just started seeing this issue after updating Xcode from 6.2 to 6.3.2. I have the latest Unity Ads package (1.2.1) and Unity 4.6.7.

    I don't have AdMob but have just added the Amazon Mobile Ads plugin. Will remove it and see what happens.

    EDIT:

    Ok it looks like a conflict with the Amazon Mobile Ads plugin for me.

    Or more precisely, it's the addition of the AmazonAd.framework alone that does it.

    i.e. Create new project with Unity Ads 1.2.1 - build to Xcode. Xcode builds ok. Add framework Xcode fails to build.

    But then removing the framework, and doing a clean and build does not fix it.
     
    Last edited: Jul 10, 2015
  18. hellobard

    hellobard

    Joined:
    Sep 26, 2012
    Posts:
    140
    I had this issue after importing 4-5 ad network plugins in the same project.
    IvyKun's solution fixed this for me, basically removing the UnityAds.framework from the Xcode project and then re-adding the file fixes it. However I have to do this everytime I open the Xcode project. This started occurring after I added Vungle's ad network plugin.

    So it seems the problem occurs with certain other plugins (AdMob, Amazon Mobile Ads and Vungle so far).
     
  19. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Well just tried this and it fixed the UnityAds issue - however I now have FacebookSDK/FacebookSDK.h file not found. I have Vungle too but not AdMob or Amazon Mobile Ads.

    EDIT:

    So I tried the same trick with the FacebookSDK.framework which got me past that issue.
     
    Last edited: Jul 24, 2015
  20. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    I thought that I'd confirmed it was due to Amazon Mobile Ads but I don't have that now. I don't have AdMob either.
     
  21. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Still getting this in 4.6.8. My fix is to simply delete the $(inherited) entry from Framework Search Paths but I'd love to see it fixed if possible.
     
  22. Eric-Laberge

    Eric-Laberge

    Joined:
    Jan 20, 2011
    Posts:
    26
    I get the same issue with Unity 5.2.
    It seems deleting the $(inherited) entry as @andymads suggested does the trick, but it messes up automated builds.
     
  23. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Please submit a bug report and perhaps we'll get somewhere with this. They've stopped fixing Unity 4 bugs from non-Enterprise customers so there's no point me sending anything as that what I use.
     
  24. poolts

    poolts

    Joined:
    Aug 9, 2012
    Posts:
    113
    Has anyone figured out how to correct this for Unity Cloud build?
     
  25. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
  26. darkhus

    darkhus

    Joined:
    Nov 30, 2012
    Posts:
    17
    if you still have this issue its most probably becaouse you got enable flag in Build Settings >>>> Apple LLVM 7.0 - Language -Modules >>>> Enable Modules (C and Objective-C) >> Yes. Just set it to "NO" and should work. In case you got other plugins which works with this flat enabled to YES, what you need to do is to add UnityAds.framewrok into your project physically (it can't be referenced). To do it: right click on your project, select "Add Files To ->NameOfYourProject<-", then in dialog window find your framework and select "Copy items if needed"...
     
    APPPublic likes this.
  27. rkjellberg

    rkjellberg

    Joined:
    Dec 25, 2015
    Posts:
    1
    I solved this by just re-installing the UnityAds package :)
     
  28. Lion-Jin

    Lion-Jin

    Joined:
    Jul 7, 2009
    Posts:
    32
    I got this problem using unity5.3.3f1 with ads service, xcode7.01... any solution?

    Edit: solved, delete UnityAds.framework and reimport
     
    Last edited: Mar 3, 2016
  29. Rcocuzzo8

    Rcocuzzo8

    Joined:
    Apr 23, 2016
    Posts:
    3
    SOLVED BY CLICKING REPLACE INSTEAD OF APPEND, stupid mistake:mad:
     
    GabLeRoux likes this.
  30. MTCool

    MTCool

    Joined:
    Oct 23, 2017
    Posts:
    8
    I redownloaded GoogleMobileAds SDK, reimported the project, added the new SDK and it helped.
     
Thread Status:
Not open for further replies.