Unity iPhone Gray Screen

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

Try keeping the original settings that you get with a freshly generated Xcode project, but add the compiler flag -fno-objc-arc to the offending file (AppLovinUnity.mm).

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

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!

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).