Blank Unity project = 600+ warnings on XCode

Pretty much as the title says… I was just testing some things and I created a blank Unity3D Project, with nothing on it. Exported for XCode > Project > Run on my iPhone and I get more than 600 alerts.

They are basically all located in .cpp files inside the Classes/Native folder and most of them are about “Value Conversion Issues”.

So… is this normal? Should I ignored them all? The project does run fine on my mobile, but all these warnings are kinda bothering me.

Unity version: 5.1.2f1 Personal
Xcode version: 6.4

Thank you.

@DanielFox

These warnings are normal, although not ideal. They are warnings in the generated C++ code created by il2cpp.exe. They should all be benign, so they can be safely ignored. At some point (hopefully soon) we will change the il2cpp.exe code generation to eliminate them.

For the most part they occur because the CLR provides some additional guarantees that we don’t properly communicate to the C++ compiler in the generated code. For example, an array index in the CLR will also fit in a 32-bit value, although in some cases a 64-bit value is used to store it. So in the generated code, il2cpp.exe just casts the 64-bit value to a 32-bit value, generating a warning.

3 Likes

This post should be pinned until this issue is eliminated IMHO.

4 Likes

Hi,

I have same problem. I using Unity 5.4.1f1 and Xcode 8.2.1, create empty project with Unity, then open without Warnings/error in Xcode, but Build for device and obtain +300 Warnings of:

*) Unused function ‘InitCrash’ → CrashReporter.mm
*) Unused function ‘InitObjCUEHandler’ → CrashReporter.mm
*) Unused variable ‘iBound’ → mscorlib_ArrayTypes.h
*) Undeclared selector ‘onUnityUpdateViewLayout’ → UnityView.mm
*) Undeclared selector ‘createUnityViewImpl’ → UnityAppcontroller.mm
*) Undeclared selector ‘createViewHierarchyImpl’ → UnityAppcontroller.mm
*) Code will never be executed:
Bulk_Generics_0.cpp
Bulk_Generics_1.cpp
Bulk_Generics_2.cpp
Bulk_Generics_3.cpp
GenericMethods0.cpp
*) ‘extern’ variable has an initializer → Il2CppCompilerCalculateTypeValues.cpp

How do I fix or remove these warnings of Xcode?

Please help me!

J

@Jamso

I thought that we had corrected all of the warnings in the generated C++ code, but it seems that a few may have crept back in. I’ll look into corrected them soon, so a newer Unity patch release should fix this. Note that the warnings should all be benign though. If you find one that impacts the runtime behavior of the project, please file a bug report, and we will correct it.

Very thanks JoshPeterson, if find problem file a bug report. A detail, I contact with support of Unity and never say this.

Jaime

Hello Josh,
I just wanted to let you know that I am still getting 600+ warnings from Xcode, although the project builds and run successfully on my iPhone.
The project is compiled with the new .net 4.6 runtime and IL2CPP.
I was building it on Xcode 9.1 , MacOS X 10.13.1

another issue I noticed is that by default Unity sets the default SDK to 7.0 but Xcode (9.x) no longer supports that so I was promoted to change it to 8.0, along with 13 more issues Xcode wanted to fix in the project settings. That went fine (I think) but after building the project, I got 600+ warnings. some are due to deprecated interface orientations and most of them are bulk_generic13.cpp warnings (semantic , unused entity)

This is something we need to correct. Which version of Unity are you using?

Note that with 2017.2.0f3, I do see many unused variable warnings. I’ll attempt to correct those. I think they can be safely ignored, as they don’t indicate an undefined behavior.

The unused variable warnings will be removed in Unity 2018.1 (which is not out yet). Unfortunately, I don’t think this is a fix we will back port though. I would recommend ignoring the warnings in Xcode. You can add the -Wno-unused-variable flag to the “Other C Flags” section of the Build Settings in Xcode (see the attached screen shot).

Hey! What about the other warnings? For example the Deprecations Warnings which are coming from Unity:

  • …/Classes/Unity/UnityInterface.h:134:36: ‘UILocalNotification’ is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework’s UNNotificationRequest
  • …/Classes/UI/OrientationSupport.mm:73:55: ‘interfaceOrientation’ is deprecated: first deprecated in iOS 8.0
  • …/Classes/UnityAppController+Rendering.mm:127:19: ‘setFrameInterval:’ is deprecated: first deprecated in iOS 10.0 - use preferredFramesPerSecond
  • …/Classes/Unity/WWWConnection.mm:350:52: ‘initWithRequest:delegate:startImmediately:’ is deprecated: first deprecated in iOS 9.0 - Use NSURLSession (see NSURLSession.h)
  • …/Classes/Unity/DisplayManager.mm:60:45: ‘UIScreenOverscanCompensationInsetApplicationFrame’ is deprecated: first deprecated in iOS 9.0 - Use UIScreenOverscanCompensationNone
  • …/Classes/AOT_XCode/Classes/UnityAppController.mm:166:78: ‘UILocalNotification’ is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework’s UNNotificationRequest
  • …/Classes/UnityAppController.mm:237:9: ‘UILocalNotification’ is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework’s UNNotificationRequest
  • …/Classes/UnityAppController.mm:237:74: ‘UIApplicationLaunchOptionsLocalNotificationKey’ is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework’s -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]
  • …/Classes/UI/UnityViewControllerBaseiOS.mm:226:72: ‘interfaceOrientation’ is deprecated: first deprecated in iOS 8.0
  • …/Classes/Unity/FullScreenVideoPlayer.mm:28:5: ‘MPMoviePlayerController’ is deprecated: first deprecated in iOS 9.0 - Use AVPlayerViewController in AVKit.

Are they also gonna be fixed, is there a way we can be doing something already? In our case we have a client who is not allowing code with warnings. :cry:

Thanks in advance!

Best regards

These errors are not related to IL2CPP generated code. They are in Objective-C code that ships with Unity. We clean them up as we can, but these deprecation warnings are difficult to manage, as we support multiple iOS API versions. In some, these are not deprecated, in others they are.

I suspect your best option is to disable these specific warnings in your Xcode project. Hopefully your client will accept that.

Sorry for the super late reply.
I was using Unity 2017.2.0p1

Can you check with a later version of Unity? If there are still there, please submit a bug report. I believe that we corrected these warnings, although I don’t think the change made it in until 2018.1 (which is in beta now).

Do you have any specific version in mind you’d like me to try.
I currently have no plans to upgrade unity until 2018.1 comes out.

The latest 2018.1 beta would be the one to try. If you would like to wait until the release, that is fine as well.

well i have 720 warnings using unity 2018.2 any suggestions how to remove this warnings and this can cause of the rejection of the app on Apple Store ?

These warnings should not cause a problem for app store submission. However, I’d like to know what is generating these warnings and correct them. Can you submit a bug report with a project that causes these warnings? We would really appreciate it.

ok will take note of most the warnings and the mayor part the are generated of illcp compile of the project i will try to get rid of them.
I will post pictures this week on the forum

This seems to still be an issue in 2018.x. Not sure how 2019 goes since our major projects are still on 2018, but I have always seen warnings from Unity projects in Xcode since I started building from iOS back in…2010? 2011?

I understand most of them are benign, but it is hard to spot things that might not be when there are hundreds of unnecessary warnings…?

1 Like