Search Unity

Can't build project in XCode because of UnityAds

Discussion in 'Unity Ads' started by utterbbq, Oct 27, 2014.

  1. utterbbq

    utterbbq

    Joined:
    Feb 16, 2014
    Posts:
    5
    Hi, I'm having some problems to compile my Xcode project using UnityAds.

    Note, that this project is originally created from Unity.

    Stuff I've done :

    1. Created a simple project in unity. All it does is basically displaying a Ad on screen.

    2. Installed Unity Ad plugin to my unity project

    3. Exported it to a IOS project from Unity

    4. Inside XCode i dragged UnityAds.framework and UnityAds.bundle into my project.

    5. Added AdSupport.framework and Storekit.framework

    This is what im getting when Linking the project :

    Undefined symbols for architecture armv7:

    "__GetNoTrackFlag", referenced from:

    RegisterMonoModules() in RegisterMonoModules-DC9EF89F0E4F4A47.o

    "__GetCFBundleID", referenced from:

    RegisterMonoModules() in RegisterMonoModules-DC9EF89F0E4F4A47.o

    ld: symbol(s) not found for architecture armv7

    clang: error: linker command failed with exit code 1 (use -v to see invocation)
     
  2. rikshot

    rikshot

    Unity Technologies

    Joined:
    Jul 15, 2013
    Posts:
    3
    Hey

    You are missing the DeviceInfo.framework from your XCode build. You can add it manually for now, the next update to the package will resolve most of these post build processing issues.

    Ville
     
    taxvi likes this.
  3. HeikkiTunkelo

    HeikkiTunkelo

    Unity Technologies

    Joined:
    May 13, 2014
    Posts:
    104
    Are you doing the project export on Windows machine?

    The current post-processing has some issues with iOS + Windows combination, but as Ville said the next package should resolve those.

    Next update is due this week, once we get all the remaining issues ironed out.

    Cheers,
    Heikki
     
  4. unity-nikkolai

    unity-nikkolai

    Unity Technologies

    Joined:
    Sep 18, 2014
    Posts:
    541
    What versions of Xcode and Unity are you using?
     
  5. utterbbq

    utterbbq

    Joined:
    Feb 16, 2014
    Posts:
    5
    Adding DeviceInfo.framework did indeed fix my problems. Thanks!

    I was building the project on windows and then i brought it over to Mac for Xcode, so that is why DeviceInfo.framework was missing.

    I'm using Unity Free version 4.5.5.
    And Xcode 6.1
     
  6. Remy_

    Remy_

    Joined:
    Jul 23, 2013
    Posts:
    5
    Hello,

    I'm having exactly the same issue but I can't find any Deviceinfo.framework anywhere T_T

    Made the project on Windows 8 and ported it on Mac OS 10 with Unity pro 4.5.5.
    Could you please tell me where you found it? Deviceinfo is in red in Xcode, and it's not available in the framework list...
     
  7. HeikkiTunkelo

    HeikkiTunkelo

    Unity Technologies

    Joined:
    May 13, 2014
    Posts:
    104
    It is under your project directory in "Assets/Plugins/iOS/DeviceInfo.framework"

    Cheers,
    Heikki
     
  8. Remy_

    Remy_

    Joined:
    Jul 23, 2013
    Posts:
    5
    In fact I had deleted the folder trying to remove conflictual plug-in ^^'

    Thanks a lot!
     
  9. Remy_

    Remy_

    Joined:
    Jul 23, 2013
    Posts:
    5
    Just in case someone Google the problem and find this :

    I still had many errors on Xcode when trying to build, the settings to resolve the problem and being able to build on device (iphone 5s) were:

    In frameworks :
    - Check that you have ONLY libiPhone-lib.a imported. I tried with 386 and dev one imported too when I had i386 errors, it had error about "duplicate" things.
    - Check for unityAds.bundle too, it was not imported by default in mine.
    - Also, the EventKit, EventKitUI, MessageUI frameworks are tagged "Required" and they weren't imported by default too (but I'm also using Unibill, maybe it has to deal with it, just try to be sure)

    In Build Settings :
    - I changed " $(ARCHS_STANDARD)" to "$(ARCHS_STANDARD_32_BIT)" for the arm 64 error

    - Supported platform on IOS but since Unity ads doesn't work in simulator I guess you could leave it on iphoneos (I just didn't move the things as everything seems right now ^^)

    I had to modify the folder for looking at libraries with the proper path (check based on your xcode project folder/Libraries with your library files in it).

    And I guess that's what worked here. As I'm new to programming and even newer to Xcode, it's still really... blurry. It seems there are known issues with Unity ads (and other ads network) so maybe we could have a special Xcode guide somewhere? That would be an AWESOME help for beginners. But maybe the update will take care of this? That would be even better :D

    Good luck !
     
  10. Aladine

    Aladine

    Joined:
    Jul 31, 2013
    Posts:
    138
    Am having the same issue and i can't fnd DeviceInfo.framwork, in fact it seems that my project is missings lots of other files, here is a screenshot of the Plugins/iOS folder :
    :

    Remark:
    this issue start to happens after removing the AppLovin plugin
    Am using unity 4.5.0f6 on Windows to create everything, then copy the project to a mac and build using 4.5.3f3.
    xCode version is 5.1
    EDIT :
    i updated to the latest version of unity 4.5.5 and still have the same issue
     
    Last edited: Nov 10, 2014
  11. hamstar

    hamstar

    Joined:
    Sep 25, 2013
    Posts:
    82
    Aladine, it seems you haven't fully removed the AppLovin plugin. Try deleting all of those AL files and then import the UintyAds package again.

    After importing the Unity Ads package, you should see DeviceInfo.framework, UnityAds.bundle, and UnityAds.framework in the Assets/Plugins/iOS folder. You may need to add the framework and bundle files in Xcode manually if it seems they are missing from the Xcode project.
     
    unity-nikkolai likes this.
  12. chazzysb

    chazzysb

    Joined:
    Jan 8, 2015
    Posts:
    6
    Hi, I added Unity Ads to my game now I can't get it to build in Xcode. Im using Xcode 6.1, Unity 4.6p5

    - When I build and run the game, it works fine on my phone and i can see the ads. but when i then build in Xcode i get 3 errors, image attached..

    Undefined symbols for architecture armv7:

    "_OBJC_CLASS_$_SKStoreProductViewController", referenced from:

    _OBJC_CLASS_$_CustomStoreProductViewController in UnityAds(UnityAds)

    "_OBJC_METACLASS_$_SKStoreProductViewController", referenced from:

    _OBJC_METACLASS_$_CustomStoreProductViewController in UnityAds(UnityAds)

    I've tried removing iAds, Build Active Architecture only.. I just seem to get different errors can anyone point me in the right direction?



    Ok found the solution to my problem... as my app did not have in app purchases i was de selecting in-app purchase under capabilities in Xcode. But this needs to be on for UnityAds.
     

    Attached Files:

    Last edited: Jan 31, 2015
  13. biscito

    biscito

    Joined:
    Apr 3, 2013
    Posts:
    83
    i found this,
    https://github.com/Applifier/unity-ads/issues/14

    so now only 2 left.. using unity 5

    Code (CSharp):
    1.  
    2. ld: warning: directory not found for option
    3. '-F"/Users/UnityProjec/metal/UnityAds"'
    4.  
    5. Undefined symbols for architecture armv7:
    6.  
    7.   "_OBJC_CLASS_$_ASIdentifierManager", referenced from:
    8.  
    9.       objc-class-ref in DeviceInfo(DeviceInfo.o)
    10.  
    11. ld: symbol(s) not found for architecture armv7
    12.  
    13. clang: error: linker command failed with exit code 1 (use -v to see invocation)
    14.  
     
    Last edited: Jan 28, 2015
  14. playentertainment

    playentertainment

    Joined:
    Jan 21, 2015
    Posts:
    45
    I have the same issue. This is very annoying! It happens in my old project and the new project as well.
     
  15. brianasu

    brianasu

    Joined:
    Mar 9, 2010
    Posts:
    368
    I had to add in the Unity ad post process script

    List<string> dependencyList = new List<string> ();
    dependencyList.Add ("DeviceInfo.framework"); <<
    dependencyList.Add ("UnityAds.framework");
    ....

    This is the only way to get it to work on cloud and normal builds. Is it normal that it creates a frameworks folder in my xcode project? I think it should only add an entry under build phases. It seems like add frameworks is doing something else.

    This is using the latest unity 5 build and ad package
     
  16. spotavi

    spotavi

    Joined:
    Aug 30, 2014
    Posts:
    31
    How to add the post process script and where ?

    Thanks in advance !
     
  17. brianasu

    brianasu

    Joined:
    Mar 9, 2010
    Posts:
    368
    Edit the file Editor\UnityAds\Scripts\UnityAdsPostProcessor.cs

    line 89 List<string> dependencyList = new List<string> ();
    dependencyList.Add ("DeviceInfo.framework"); << add this

    The new update might fix this not sure.
     
  18. Uzair-Mahmood

    Uzair-Mahmood

    Joined:
    Mar 21, 2015
    Posts:
    9
    Hello. if anybody is still having this issue, i added the dependencyList.Add ("DeviceInfo.framework"); ,
    But the issue is the DeviceInfo Framework is not in my assets/plugins/ios folder either. i can't find this framework anywhere in my project files. I'm getting linker error because it can't find DeviceInfo.framework. anywhere i can download and place it in my project?
     
  19. yrj

    yrj

    Joined:
    Mar 28, 2013
    Posts:
    2
    I have the same issue. I tried to find solution for two days and I have no idea what to do. Does anybody have DeviceInfo.framework at all? I think I can download it from somewhere in the internet but I can't.

     
  20. roundham

    roundham

    Joined:
    Oct 28, 2014
    Posts:
    46
    I had the same problem as utterbbq. The problem was resolved when I updated my Xcode to 6.3. It was 6.1 before. I also have Unity 5. Try updating both Xcode and Unity to latest. I hope this helps.