Search Unity

Needing a little help iOS under unity 5

Discussion in 'Unity Ads & User Acquisition' started by RustyFlash, Feb 3, 2015.

  1. RustyFlash

    RustyFlash

    Joined:
    Oct 8, 2014
    Posts:
    88
    Ok, have everything working perfectly in the editor under unity 5 beta 21. (couple of minor depredations fixed to enable compile).

    But... (and there always is one isn't there)

    When compiling to device (iOS) compilation fails with these errors that I cannot fix (sorry to post as code, formats nicer)?

    Code (CSharp):
    1. Undefined symbols for architecture armv7:
    2.   "_OBJC_CLASS_$_ASIdentifierManager", referenced from:
    3.       objc-class-ref in DeviceInfo(DeviceInfo.o)
    4.   "UnityPause(bool)", referenced from:
    5.       -[UnityAdsUnityWrapper unityAdsDidShow] in UnityAdsUnityWrapper.o
    6.       -[UnityAdsUnityWrapper unityAdsDidHide] in UnityAdsUnityWrapper.o
    7. ld: symbol(s) not found for architecture armv7
    8. clang: error: linker command failed with exit code 1 (use -v to see invocation)
    Any help would be really appreciated and joy would certainly be jumped.
     
  2. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Do you have "In-App Purchase" Capability enabled in Xcode before building?
     
  3. RustyFlash

    RustyFlash

    Joined:
    Oct 8, 2014
    Posts:
    88
    No, I dont. I did not realise it was needed?
     
  4. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Yeah, that should be enabled for App Store functionality.
     
  5. RustyFlash

    RustyFlash

    Joined:
    Oct 8, 2014
    Posts:
    88
    Just curious, but I don't understand the connection between me just wanting to display an advert and the need for App Store functionality. I must be missing something here.

    Also, the UnityPause() function is a problem.
     
  6. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    The ads are for games in the App Store. When the ad finishes, users are presented with the option to download the game. Unity Ads needs this functionality to open up the App Store.

    What's the issue you're having with UnityPause()?
     
  7. RustyFlash

    RustyFlash

    Joined:
    Oct 8, 2014
    Posts:
    88
    Thanks for the info. It makes sense now.

    Currently, my app is not added to iTunes connect. Need to set a new developer licence for this release at a later date.

    So, in Xcode I need to turn on in-app purchasing for this to compile. I will check that later.

    As for the unityPause() error this is just a compilation error that I get and have displayed in the first post. I can comment out the code in unityAds (but obviously it is needed - though I also pause my app when an ad is shown). It is used in DidShow and DidHide (though it is also used in other parts of the ad code though without throwing an error).

    Also, the asset store download omits MiniJSON. Easy to remedy but perhaps worth adding to the install for ease.
     
  8. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Hmm, MiniJSON should be included, but as part of the UnityEngine.Advertisements.MiniJSON namespace.

    Might be worth removing all Unity Ads assets from your project and reimporting the latest asset package from the Asset Store. You could be missing parts of the package, or they could be out of place in your project directory structure.
     
  9. RustyFlash

    RustyFlash

    Joined:
    Oct 8, 2014
    Posts:
    88
    I have added "in-app purchase" to Xcode and it is reporting that it is on and a tick is next to both "Link StoreKit.framework" and "Add the 'In-App Purchase' entitlement to your App ID" and still get the same errors?

    Code (CSharp):
    1. Undefined symbols for architecture armv7:
    2.   "_OBJC_CLASS_$_ASIdentifierManager", referenced from:
    3.       objc-class-ref in DeviceInfo(DeviceInfo.o)
    4.   "UnityPause(bool)", referenced from:
    5.       -[UnityAdsUnityWrapper unityAdsDidShow] in UnityAdsUnityWrapper.o
    6.       -[UnityAdsUnityWrapper unityAdsDidHide] in UnityAdsUnityWrapper.o
    7. ld: symbol(s) not found for architecture armv7
    8. clang: error: linker command failed with exit code 1 (use -v to see invocation)
    Is this a Unity 5 beta issue or am I a complete numpty?

    downloaded the latest from asset store with the same result? There must be something I am missing?

    ps. Failing a fix for now (if this is a Unity 5 beta 21 issue) is there an easy way to enable compilation to device without the need of removing all unity ads code?

    pps. using UnityAds v1.0.4
     
    Last edited: Feb 5, 2015
  10. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    I didn't realize you were using Unity 5. There are still issues with Unity Ads under Unity 5.

    Until we have an update that fixes them, please follow these steps:

    DeviceInfoIos.cs:
    Change return iPhone.advertisingIdentifier; to return iOS.Device.advertisingIdentifier;

    UnityAdsPostprocessor.cs (Available on release 1.0.3):
    Change BuildTarget.iPhone to BuildTarget.iOS

    UnityAdsUnityWrapper.mm:
    Change void UnityPause(bool pause); to void UnityPause(int pause);
    Change UnityPause(true) to UnityPause(1)
    Change UnityPause(false) to UnityPause(0)
     
  11. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Actually, I'm still getting the same errors here. Trying to establish a workaround.

    I'll post an update once I have it.
     
  12. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    In addition to the UnityAds.framework, make sure Linked Frameworks and Libraries also includes the following:
    • StoreKit.framework
    • AdSupport.framework
    • CoreTelephony.framework
     
    cryptoforge likes this.
  13. RustyFlash

    RustyFlash

    Joined:
    Oct 8, 2014
    Posts:
    88
    Thanks Nikkolai.

    Sorry for the confusion. I did mention that I was using the beta in the first post. Seeing that I was only getting the three errors, I thought I would cry for help in case there was a work-around.

    I don't really want to remove unityAds from the project as a lot of code was added when testing in the editor (where it was working fine) but it currently has the downside that I cannot test on device. Not a major worry atm though.

    Thanks for your time and patience.
     
    Last edited: Feb 6, 2015
  14. RustyFlash

    RustyFlash

    Joined:
    Oct 8, 2014
    Posts:
    88
    Also, CoreTelephony.framework is not present in the generated project?
     
  15. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Sorry, you're right. You did mention you were using Unity 5. I completely over looked it. Until we have an update that fixes these issues with Unity Ads in Unity 5, you'll need to make those changes I mentioned before:
    And also add the StoreKit, AdSuppport, and CoreTelephony frameworks:
    1. Select your project from the Project Navigator
    2. Select the General tab
    3. Scroll down to view Linked Frameworks and Libraries
    4. Press the + icon at the bottom of the list to Add items
    With those added, you should be able to build without any further issues. Let me know how it works out.
     
    HSP_Studio and Heykinox like this.
  16. RustyFlash

    RustyFlash

    Joined:
    Oct 8, 2014
    Posts:
    88
    Thanks for your help. That all worked a treat.

    Sorry for the delay in the reply.
     
  17. RustyFlash

    RustyFlash

    Joined:
    Oct 8, 2014
    Posts:
    88
    Is there a way to automate unitys inclusion of the frameworks when the project is built?
    I only ask as I often need to replace the old project when compiling a new version to Xcode as there is a minor unity bug that results in a null error when appending to the Xcode project. This means that each time I have to add the frameworks. Not a problem of course, but would be nice to omit this step.
     
  18. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Please can we hurry with the update :), also can confirm this issue, Unity 5 is on RC1 already, we should be getting final builds out to support it.
     
    Last edited: Feb 9, 2015
  19. RustyFlash

    RustyFlash

    Joined:
    Oct 8, 2014
    Posts:
    88
    It's not a major problem. Rc1 is only a step up from beta test. There could still be a way to go as yet until the final is released.
    Luckily the fix for unityAds is not too demanding.
     
  20. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Yes the above workaround worked, but I'm just saying if its ok then include it in the next Unity Ads package or have the next package work with Unity 5, thing is all services from Unity should be releasing some kind of updates to support 5 even in the RC1 stage, I'm sure they have it all planned, just wondering when it be ready.
     
  21. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Actually there is. When you select UnityAdsUnityWrapper.mm in the Project panel, you'll see a list of framework dependencies in the Inspector. You can check off StoreKit, AdSuppport, and CoreTelephony here, that way when you build, they'll automatically be included with your Xcode project.

    Still no ETA on the update. We're a little tight on resources at the moment, especially with GDC around the corner. Hoping we'll have it available before then, but I can't make any promises just yet. In the meantime, I'm working on getting our documentation up to date. Having current info in the docs should help you guys out a lot, especially for situations like this.

    This forum has been a good resource. Will definitely be sourcing it with the docs revision.
     
  22. RustyFlash

    RustyFlash

    Joined:
    Oct 8, 2014
    Posts:
    88
    Thanks a lot for that info, really helpful :)
     
    unity-nikkolai likes this.
  23. Poelam

    Poelam

    Joined:
    Aug 29, 2013
    Posts:
    5
    I got the following errors, is it related to any setting on xcode?

    Undefined symbols for architecture arm64:

    "_kUnityAdsRewardItemNameKey", referenced from:

    _getRewardItemDetailsWithKey in UnityAdsUnityWrapper.o

    _getRewardItemDetailsKeys in UnityAdsUnityWrapper.o

    "_kUnityAdsRewardItemPictureKey", referenced from:

    _getRewardItemDetailsWithKey in UnityAdsUnityWrapper.o

    _getRewardItemDetailsKeys in UnityAdsUnityWrapper.o
     
  24. RustyFlash

    RustyFlash

    Joined:
    Oct 8, 2014
    Posts:
    88
    I am not getting any of them errors? Are you building just for 64bit?
     
  25. HeikkiTunkelo

    HeikkiTunkelo

    Unity Technologies

    Joined:
    May 13, 2014
    Posts:
    104
    The updated version is currently in testing and we should have it out early next week.

    Cheers,
    Heikki
     
    RustyFlash and MrEsquire like this.
  26. cryptoforge

    cryptoforge

    Joined:
    Jan 21, 2015
    Posts:
    60
    Just dropped a lot of money to get Unity 5 and wasted the whole weekend dealing with this issue. But your solution worked on a blank project. Can't wait until it's all streamlined and works like it should.

    Just a heads up there is a different issue happening when you use BuildPipeline along with UnityAds.

    It says that /Assets/Plugins/iOS/UnityAdsUnityWrapper.h:7:9: 'UnityAds/UnityAds.h' file not found.
    All though, I have the framework linked to the project.
     
    Last edited: Mar 2, 2015
  27. HeikkiTunkelo

    HeikkiTunkelo

    Unity Technologies

    Joined:
    May 13, 2014
    Posts:
    104
    Hi,

    An update for UnityAds is available in Asset Store. This has been tested with 4.X series and 5 series. It works with the latest Beta/RC's.

    Let us know if you experience any more problems with it.

    Cheers,
    Heikki
     
    cryptoforge and RustyFlash like this.
  28. cybershead

    cybershead

    Joined:
    Feb 12, 2012
    Posts:
    44
    I am so happy i found this post, I was going crazy. I not only have UnityAds Errors using Unity5 but other errors in Xcode, but i guess thats another forum. But i will wait for a patch before i try to realise my game.

    Thanks for posting Heikki
     
  29. HeikkiTunkelo

    HeikkiTunkelo

    Unity Technologies

    Joined:
    May 13, 2014
    Posts:
    104
    Hi Cybershead,

    The new package is already out there so you can start using it.

    However, due to things being a bit different on Unity 5, we had to change the package structure AND: simply updating the package does not remove the old package from your project, so you will still get compile errors (if you have tried with the earlier version).
    See here: http://forum.unity3d.com/threads/unity-ads-1-1-0-compile-errors.306718/

    TL;DR: remove the "Assets/Standard Assets/UnityAds" directory and reimport.

    Cheers,
    Heikki
     
  30. cryptoforge

    cryptoforge

    Joined:
    Jan 21, 2015
    Posts:
    60
    Awesome, the update works when you build from the editor. However, it still does not work if you try to make a build at runtime here is the info.

    InvokingMethod:

    Code (CSharp):
    1.    
    2. [MenuItem("AutoBuilder/iOS")]
    3. static void PerformiOSBuild ()
    4.  {
    5.    EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.iOS);;
    6.    BuildPipeline.BuildPlayer(GetScenePaths(), "Builds/iOS", BuildTarget.iOS, BuildOptions.SymlinkLibraries | BuildOptions.AutoRunPlayer);
    7. }
    8.  
    Error:


    Any ideas?
     
  31. cybershead

    cybershead

    Joined:
    Feb 12, 2012
    Posts:
    44
    I knew I should have brought my laptop with me to work, I really hope i can do this for a living one day, then i would not have to wait a whole day to test.
    Thank you for that information and I will test this out tonight. Have a good day.

    Chris
     
  32. cybershead

    cybershead

    Joined:
    Feb 12, 2012
    Posts:
    44
    Heya Heikki,

    I did what you said but found my Mac must have cached old files or something as i still had the errors in the image below after deleting and replacing the Ads folder and even when i deleted all related Ads files.
    After taking the steps of AMENDMENT 1A and reinstalling Unity Ads, i finally got it to build and could once again test on my iOS phone. My next step is to see if i can add Nikkolai Davenport's scripts as that helped me control what happens after they watched the movie or not etc.
    Thanks for your help.

    Chris

    AMENDMENT 1B: Nikkolai Davenport's scripts now also working.

    AMENDMENT 1A: OK I used Clean my mac that gets rid of old files etc and rebooted and i have lost all errors apart from the Yellow ones that i think have been fixed in the 4.6x Patches. I am going to add Unity Ads again and let you know what happends.


    ads.jpg
     
    Last edited: Mar 5, 2015
  33. placebo1804

    placebo1804

    Joined:
    Jul 1, 2014
    Posts:
    1
    Hi guys! Can you help me....When i build on Simulator SDK everything works fine (Xcode didn't show alerts), but when I try to do the build on Device SDK i got this msg:
     
  34. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Version 1.1.2 was released yesterday. Please remove the existing Unity Ads package from your project before reimporting the latest.

    Assets are located in the following locations:
    /Assets/StandardAssets/UnityAds
    /Assets/Plugins/Android/unityads
    /Assets/Plugins/iOS

    When you build for iOS, make sure you set the Scripting Backend to IL2CPP and set the Architecture to Universal.

    If you are using Unity 4.6.3, make sure you have the latest patch update installed. There are a number of fixes for IL2CPP for iOS.

    http://unity3d.com/unity/qa/patch-releases
     
  35. cybershead

    cybershead

    Joined:
    Feb 12, 2012
    Posts:
    44
    Thats great,

    When will we get a patch for Unity 5 with IL2CPP fixes?

    Chris
     
  36. zombox

    zombox

    Joined:
    Aug 10, 2011
    Posts:
    119
    Thank you thank you thank you!!!

    I've been dealing with Mach-O errors all night, trying everything to fix them importing the latest Unity Ads plugin update.

    Updating to 4.6.3.p2 fixed them!
     
  37. DevSpur

    DevSpur

    Joined:
    Jul 19, 2014
    Posts:
    20
    Hi there i am getting the same problem and i am using the latest unity5 and its a pro license and I've got all the frame work that was said earlier and in app purchases on and I'm still get this error

    1. Undefined symbols for architecture armv7:
    2. "_OBJC_CLASS_$_ASIdentifierManager", referenced from:
    3. objc-class-ref in DeviceInfo(DeviceInfo.o)
    4. "UnityPause(bool)", referenced from:
    5. -[UnityAdsUnityWrapper unityAdsDidShow] in UnityAdsUnityWrapper.o
    6. -[UnityAdsUnityWrapper unityAdsDidHide] in UnityAdsUnityWrapper.o
    7. ld: symbol(s) not found for architecture armv7
    8. clang: error: linker command failed with exit code 1 (use -v to see invocation)
    Any help would be really appreciated
     
  38. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Under Player Settings, make sure Scripting Backend is set to IL2CPP and Architecture is set to Universal before building to iOS. If you are rebuilding your Xcode project to the same directory, make sure you select Replace instead of Append. In the past, there have been issues due to using the Append option.
     
  39. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    I'm getting lots of Semantic Issue. I have Unity 5.0.1p3 Personal and Unity Ads 1.1.4. Are there any known issues causing this?

    I have tried deleting all the Unity Ads folders and downloaded the asset again and build the game on a new folder, but for some reason it just won't work. Backed is also set to IL2CPP and Architecture to Universal.
     
  40. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    What errors are you seeing? Are you getting errors in Xcode or within Unity?
     
  41. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    Ok, so after last night trying to get this to work but filled with Semantic Issue errors in xCode, I build the game today to give you the errors - but they were gone. So I'm guessing that when you install Unity Ads from clean slate or set to IL2CPP and Architecture to Universal you also need to restart whole Unity.

    I make my games with Windows 7, then export them as Unity Packages to my Mac. So Unity Ads were originally imported in Windows environment. I did try to re-import the Unity Ads from Asset Store but I guess there were some metadata or something (I know nothing about) remaining from Windows version until Unity was restarted.
     
  42. Heykinox

    Heykinox

    Joined:
    Sep 28, 2013
    Posts:
    4
    Thanks a lot, this solved my issue with the integration of InMobi on iOS under Unity 5 !
     
  43. MANISH KUMAR

    MANISH KUMAR

    Joined:
    Nov 22, 2010
    Posts:
    57
    Hi ,
    I am using unity 5.0.2 and xcode 6.4 version .
    I build in ios then , give me two issues .
    Unity Pause Issue
    Linking failure issue .
    something ARM issue .
    Please give me diagrammatic view for this solution.
     
  44. MANISH KUMAR

    MANISH KUMAR

    Joined:
    Nov 22, 2010
    Posts:
    57
    On Unity Asset Store ,
    Is updated unity ads or not ?