[Closed]Bug: Unity 5.3.4p6, enabling IAP + Analytics settings not saving, with Jenkins CI autobuilds

In Editor on MacOSX Unity 5.3.4p6

  • switch the Windows/Services/Purchasing and Windows/Services/Analytics switches from OFF to ON
  • save project/scene, etc…
  • close, reopen Unity, project builds/plays just fine. iOS good, etc…

Open project on another computer (this time is Windows 10 Unity 5.3.4p6)

  • We get errors related to missing DLLs related to purchasing
  • Once we goto Windows / Services, we see that Analytics and Purchasing is set to “OFF”
  • Once we turn those back to ON, the project can now Play in the editor…

Auto build project using Jenkins (MacOSX macMini, Unity 5.3.4p6)

  • On that machine, We can bring up Unity Editor, manually turn those switches to ON, and it builds in editor
  • We have also seen, that when you simply give focus to the Windows / Services tab, that errors go away. (this is madness to us :slight_smile: )
  • However in spite of enabling these, per editor, when Jenkins does the auto build, the build fails.

How do we get this setting to stick with the project we have in our source control?
Rather than with the editor?

Errors in Windows Unity 5.3.4p6

Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.

  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)

  at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0

  at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0

  at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0

  at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0

  at Mono.CSharp.Driver.LoadReferences () [0x00000] in <filename unknown>:0

  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0

  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0

The following assembly referenced from D:\GTX\trunk\MedicalUnity\Assets\Plugins\UnityPurchasing\Bin\Stores.dll could not be loaded:
  Assembly:  UnityEngine.Purchasing  (assemblyref_index=1)
  Version:  0.0.0.0
  Public Key: (none)
The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (D:\GTX\trunk\MedicalUnity\Assets\Plugins\UnityPurchasing\Bin\).

Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
The class UnityEngine.Purchasing.IAmazonExtensions could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
The class UnityEngine.Purchasing.IAmazonExtensions could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
The class UnityEngine.Purchasing.IGooglePlayConfiguration could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
The class UnityEngine.Purchasing.NativeJSONStore could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
The class UnityEngine.Purchasing.IAppleConfiguration could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
The class UnityEngine.Purchasing.IAppleExtensions could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
The class DialogType could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
The class MicrosoftConfiguration could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
The class UnityEngine.Purchasing.FakeStore could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
The class DialogRequest could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
The class LifecycleNotifier could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
The class <MessageCallback>c__AnonStorey0 could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
The class <RetrieveProducts>c__AnonStorey0 could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
The class <Purchase>c__AnonStorey1 could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
The class <StartUI>c__AnonStorey0`1 could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
The class <OnProductListReceived>c__AnonStorey0 could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
The class <log>c__AnonStorey1 could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
The class <OnPurchaseFailed>c__AnonStorey2 could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
The class <OnPurchaseSucceeded>c__AnonStorey3 could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null
The class <OnProductListError>c__AnonStorey4 could not be loaded, used in Stores, Version=1.0.5974.32831, Culture=neutral, PublicKeyToken=null

And here are the Jenkins errors:

-----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Assembly-CSharp.dll
Compilation failed: 3 error(s), 0 warnings
-----CompilerOutput:-stderr----------
Assets/Scripts/Managers/BackendManager.cs(306,7): error CS0103: The name `Analytics' does not exist in the current context
Assets/Scripts/Managers/BackendManager.cs(323,7): error CS0103: The name `Analytics' does not exist in the current context
Assets/Scripts/Managers/BackendManager.cs(331,7): error CS0103: The name `Analytics' does not exist in the current context
-----EndCompilerOutput---------------
- Finished compile Library/ScriptAssemblies/Assembly-CSharp.dll
Assets/Scripts/Managers/BackendManager.cs(306,7): error CS0103: The name `Analytics' does not exist in the current context
(Filename: Assets/Scripts/Managers/BackendManager.cs Line: 306)

Assets/Scripts/Managers/BackendManager.cs(323,7): error CS0103: The name `Analytics' does not exist in the current context
(Filename: Assets/Scripts/Managers/BackendManager.cs Line: 323)

Assets/Scripts/Managers/BackendManager.cs(331,7): error CS0103: The name `Analytics' does not exist in the current context
(Filename: Assets/Scripts/Managers/BackendManager.cs Line: 331)

- Finished compile Library/ScriptAssemblies/Assembly-UnityScript.dll
WeaveUnetFromEditor Temp/Assembly-UnityScript.dll
Ignoring '/Applications/Unity_5_3_4p6/Unity.app/Contents/UnityExtensions/Unity/Advertisements/UnityEngine.Advertisements.dll' because we're compiling for Editor
Ignoring '/Applications/Unity_5_3_4p6/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll' because we're compiling for Editor
Ignoring 'Assets/Plugins/UnityPurchasing/Bin/Apple/live/Apple.dll' because we're compiling for Editor
Ignoring 'Assets/Plugins/UnityPurchasing/winrt/live/winrt.dll' because we're compiling for Editor
WeaveAssemblies unityPath= /Applications/Unity_5_3_4p6/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll
WeaveAssemblies unetPath= /Applications/Unity_5_3_4p6/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll
Symbols will be read from Temp/Assembly-UnityScript.dll.mdb
Script Module: Assembly-UnityScript
Ignoring '/Applications/Unity_5_3_4p6/Unity.app/Contents/UnityExtensions/Unity/Advertisements/Editor/UnityEditor.Advertisements.dll' because we're compiling for AndroidPlayer
Ignoring '/Applications/Unity_5_3_4p6/Unity.app/Contents/UnityExtensions/Unity/Advertisements/UnityEngine.Advertisements.dll' because we're compiling for AndroidPlayer
Ignoring '/Applications/Unity_5_3_4p6/Unity.app/Contents/UnityExtensions/Unity/EditorTestsRunner/Editor/UnityEditor.EditorTestsRunner.dll' because we're compiling for AndroidPlayer
Ignoring '/Applications/Unity_5_3_4p6/Unity.app/Contents/UnityExtensions/Unity/EditorTestsRunner/Editor/nunit.framework.dll' because we're compiling for AndroidPlayer
Ignoring '/Applications/Unity_5_3_4p6/Unity.app/Contents/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll' because we're compiling for AndroidPlayer
Ignoring '/Applications/Unity_5_3_4p6/Unity.app/Contents/UnityExtensions/Unity/Networking/Editor/UnityEditor.Networking.dll' because we're compiling for AndroidPlayer
Ignoring '/Applications/Unity_5_3_4p6/Unity.app/Contents/UnityExtensions/Unity/TreeEditor/Editor/UnityEditor.TreeEditor.dll' because we're compiling for AndroidPlayer
Ignoring '/Applications/Unity_5_3_4p6/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll' because we're compiling for AndroidPlayer
Ignoring 'Assets/AmplifyMotion/Plugins/Editor/AmplifyMotionEditor.dll' because we're compiling for AndroidPlayer
Ignoring 'Assets/Curvey/Packages/Curvy/Base/Editor/Resources/CurvyEditorIcons.dll' because we're compiling for AndroidPlayer
Ignoring 'Assets/Plugins/UnityPurchasing/Bin/Apple/live/Apple.dll' because we're compiling for AndroidPlayer
Ignoring 'Assets/Plugins/UnityPurchasing/Bin/Editor.dll' because we're compiling for AndroidPlayer
Ignoring 'Assets/Plugins/UnityPurchasing/winrt/live/winrt.dll' because we're compiling for AndroidPlayer
Error building Player because scripts had compiler errors
(Filename:  Line: -1)

Load scene 'Temp/__Backupscenes/0.backup' time: 0.018291 ms
Unloading 65 Unused Serialized files (Serialized files now loaded: 0)
System memory in use before: 92.3 MB.
System memory in use after: 92.5 MB.

Unloading 59 unused Assets to reduce memory usage. Loaded Objects now: 2707.
Total: 7.878482 ms (FindLiveObjects: 0.183918 ms CreateObjectMapping: 0.075706 ms MarkObjects: 7.538647 ms  DeleteObjects: 0.079451 ms)

Unloading 0 Unused Serialized files (Serialized files now loaded: 0)
System memory in use before: 90.7 MB.
System memory in use after: 90.9 MB.

Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 2707.
Total: 6.749925 ms (FindLiveObjects: 0.167736 ms CreateObjectMapping: 0.051633 ms MarkObjects: 6.523595 ms  DeleteObjects: 0.005811 ms)

Ignoring '/Applications/Unity_5_3_4p6/Unity.app/Contents/UnityExtensions/Unity/Advertisements/UnityEngine.Advertisements.dll' because we're compiling for Editor
Ignoring '/Applications/Unity_5_3_4p6/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll' because we're compiling for Editor
Ignoring 'Assets/Plugins/UnityPurchasing/Bin/Apple/live/Apple.dll' because we're compiling for Editor
Ignoring 'Assets/Plugins/UnityPurchasing/winrt/live/winrt.dll' because we're compiling for Editor
Ignoring '/Applications/Unity_5_3_4p6/Unity.app/Contents/UnityExtensions/Unity/Advertisements/UnityEngine.Advertisements.dll' because we're compiling for Editor
Ignoring '/Applications/Unity_5_3_4p6/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll' because we're compiling for Editor
Ignoring 'Assets/Plugins/UnityPurchasing/Bin/Apple/live/Apple.dll' because we're compiling for Editor
Ignoring 'Assets/Plugins/UnityPurchasing/winrt/live/winrt.dll' because we're compiling for Editor
- starting compile Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll, for buildtarget 13
- starting compile Library/ScriptAssemblies/Assembly-UnityScript-firstpass.dll, for buildtarget 13
Unloading 13 Unused Serialized files (Serialized files now loaded: 0)
System memory in use before: 91.0 MB.
System memory in use after: 91.2 MB.

Unloading 13 unused Assets to reduce memory usage. Loaded Objects now: 2707.
Total: 11.615661 ms (FindLiveObjects: 0.294843 ms CreateObjectMapping: 0.153083 ms MarkObjects: 11.116170 ms  DeleteObjects: 0.050650 ms)


*** Cancelled 'Build.Player.AndroidPlayer' in 8 seconds (8348 ms)

Exception: BuildPlayer failure: Error building Player because scripts had compiler errors
  at BuildCommands.GenericBuild (System.String[] scenes, System.String targetDir, BuildTarget buildTarget, BuildOptions buildOptions) [0x0001d] in /Users/gtx/.jenkins/jobs/Airways_Android/workspace/Assets/Editor/BuildBot/BuildCommands.cs:36
  at BuildCommands.AndroidBuild () [0x00016] in /Users/gtx/.jenkins/jobs/Airways_Android/workspace/Assets/Editor/BuildBot/BuildCommands.cs:26
(Filename: Assets/Editor/BuildBot/BuildCommands.cs Line: 36)

executeMethod method BuildCommands.AndroidBuild threw exception.
(Filename: /Users/builduser/buildslave/unity/build/Runtime/Utilities/Argv.cpp Line: 168)


Aborting batchmode due to failure:
executeMethod method BuildCommands.AndroidBuild threw exception.

***Thread 'UnityLookForNewInputDevices' is still running!***
(Filename: /Users/builduser/buildslave/unity/build/Runtime/Threads/Thread.cpp Line: 68)

***Thread was not cleaned up!***
(Filename: /Users/builduser/buildslave/unity/build/Runtime/Threads/Posix/PlatformThread.cpp Line: 45)

FATAL: Unity3d command line execution failed with status 1
Build step 'Invoke Unity3d Editor' marked build as failure

Several members of our team just noticed their Windows/Services/Purchasing and Analytics all just turned OFF! Why would this happen randomly, while our Unity Editors were open? To multiple people?

Shouldn’t this either 1.) be set by our cloud project or 2.) stick with our project settings… currently it seems to just reset.

UPDATE: just filed a unity bug report using Help menu… ID is 798082 in FogBugz

I may have gotten somewhere with this and wanted to update you.

I think the problem was related to having a UnityAnalyticsManger.asset in our ProjectSettings folder on SVN. That Analytics Manager file had enable analytics set to 0.

It looks like this file has been deprecated in the latest Unity release. So my guess is Unity tried to auto update the file by reading the status of enable Analytics an sets that status to the new UnityConnectSettings.asset. After the property is transferred over It then deletes the deprecated UnityAnalyticsManger.asset from the project but obviously not from version control.

So the next time we updated Unity would override our correctly configured UnityConnectionSetting.asset with the legacy incorrect UnityAnalyticsManger.asset settings.

Removing the UnityAnalyticsManger.asset from SVN seems to fix the strange platform switching problems and the build bot now completes successfully. somebody should look into the auto update logic to make sure it’s not overriding settings it shouldn’t be.

1 Like

Hi @subatomic ,

I’m glad you were able to figure out the issue with the switches turning off. I’m not sure off the top of my head who manages the UnityConnectionSetting.asset file, but I will see if I can look into it and report the bug. Thanks very much!

/* EDIT: I mis-typed I see the issue is with the UnityAnalyticsManager.asset file and we’re looking into it! */

Hi @subatomic ,

You’re correct in your assertion that the issue is the UnityAnalyticsManager.asset has been replaced by
UnityConnectSettings.asset. When working in the editor the file will be deleted, but having it checked in to SVN replaced the file. You are also correct about removing UnityAnalyticsManager.asset from SVN is the fix, and aren’t overwriting settings by doing so. We are currently reviewing your ticket, 798082.

thanks again!

1 Like