Player Export Failed! Unity cloud build fails everytime

Hi,

For the past two weeks I am facing this issue whenever I try to build my project using unity cloud build.

Here is the log:

680: [Unity] UnityException: GetBool is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject ‘WelcomeWindow’.
681: [Unity] Rethrow as TypeInitializationException: An exception was thrown by the type initializer for RelationsInspector.WelcomeWindow
682: [Unity] Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
683: [Unity] UnityException: GetBool is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject ‘WelcomeWindow’.
684: [Unity] Rethrow as TypeInitializationException: An exception was thrown by the type initializer for RelationsInspector.WelcomeWindow
685: [Unity] Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
686: [Unity] UnityException: GetBool is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject ‘WelcomeWindow’.
687: [Unity] Rethrow as TypeInitializationException: An exception was thrown by the type initializer for RelationsInspector.WelcomeWindow
688: [Unity] Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
689: [Unity] UnityException: GetBool is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject ‘WelcomeWindow’.
690: [Unity] Rethrow as TypeInitializationException: An exception was thrown by the type initializer for RelationsInspector.WelcomeWindow
691: [Unity] Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
692: [Unity] UnityEngine.Debug:LogWarning(Object)
693: [Unity] Player export failed. Reason: 4 errors
694: ! build of ‘default-ios-new’ failed. compile failed
695: publishing finished successfully.
696: Finished: FAILURE

I have tried almost all the things available in google :confused:

Please advise.
Regards,

The error message pretty much says it all - you’re calling an API (GetBool) from a location that you shouldn’t call it (constructor or instance field initializer). The class you’re doing this in is called WelcomeWindow.

So, to solve this, open WelcomeWindow and make sure you’re not calling GetBool from the constructor or any field initializers.

@liortal Thank you for responding :slight_smile:

But I am using no such script. I thought they the project error might be due to oneSignal so I have removed OneSignal from the Project and now I am facing another issue.

[Unity] Shader compiler: internal error compiling shader snippet type=0 platform=5: Protocol error - failed to read correct magic number
728: [Unity] Shader error in ‘Sprites/Default’: Internal error communicating with the shader compiler process
729: [Unity] UnityEngine.Debug:LogWarning(Object)
730: [Unity] Player export failed. Reason: 5 errors
731: ! build of ‘default-android’ failed. compile failed
732: publishing finished successfully.
733: Finished: FAILURE

Please advise.

Building locally works fine? also, are you using the same Unity version locally vs. in the cloud ?

Yes Build works fine locally. And yes I am using same unity version at both end. (Unity 5.6.1 f1)

Hi guys,

I am still facing the same issue. I have upgraded unity to 2017.1.0f3 and then tried but the result is the same. I am unable to figure out where is the exact problem. As shown in the above log, the getBool issue is in the WelcomeWindow but there is no such script in my project. There is a single folder by the name of “WelcomeWindow” which is a part of CoreGameKit.

Please advise.
Thank you.