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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity iPhone Gray Screen

Discussion in 'iOS and tvOS' started by shCold, Apr 22, 2015.

  1. shCold

    shCold

    Joined:
    Apr 21, 2015
    Posts:
    8
    Hello guys,

    I'm struggling for day 2 to run my game on iOS and at the moment i don't have a clue what is going on.
    Here is what happening:

    I export my project with il2cpp and universal architecture selected, i'm using Unity 5.0.1 and xCode 6.3.1.
    The build fron Unity goes like a charm, no errors.
    Then i open the xCode project and start to run the project on my phone.
    1st i've got an error:
    /Users/coldwave/Desktop/fffffffuuuu/ex/Libraries/Plugins/iOS/AppLovinUnity.mm:49:86: 'retain' is unavailable: not available in automatic reference counting mode

    I'm fixing this error by setting:
    Apple LLVM 6.1 - Language - Objective C
    Objective-C Automatic Reference Counting : from Yes to NO

    This change fixes all the issues with ARC Restrictions, Semantic Issue.

    After that i've run again on my iPhone 5s, the project DO transfer to the phone and i've got gray screen.
    No unity logo or so.
    When i unplug the iOS cable and try to run the build without debugging the application Opens and Close instantly.

    I thought it was a certificate problem but i'm signing the app with the right Provisioning Profile, it detects it and everything is cool.
    I've tried to change each setting in Unity Build Settings and recompile and run, nothing seems to work.

    At the moment i don't have any more ideas.
    Any ideas guys?


    p.s. The game is running just fine on Android and in the Editor
     
  2. aihodge

    aihodge

    Joined:
    Nov 23, 2014
    Posts:
    164
    Try keeping the original settings that you get with a freshly generated Xcode project, but add the compiler flag
    Code (CSharp):
    1. -fno-objc-arc
    to the offending file (AppLovinUnity.mm).

    Edit for clarity: You would add this compiler flag in Targets > Build Phases > Compile Sources.
     
  3. shCold

    shCold

    Joined:
    Apr 21, 2015
    Posts:
    8
    Hi aihodge,


    I've made a fresh build from Unity, clear the xCode cache and it worked!!!!
    Can you explain what happens and why i needed to add this?

    Thanks for the help man, it was 2 days 24/7 of trying to fix it!
     
    Last edited: Apr 22, 2015
  4. aihodge

    aihodge

    Joined:
    Nov 23, 2014
    Posts:
    164
    That compiler flag allows you to disable ARC for specific files rather than disabling it for the entire project, in which other files are relying on ARC for their memory management. It appears that the AppLovinUnity plugin still uses pre-ARC reference counting (retain).