Unity Services and Jenkins CI problem

Hi,

I have setup a CI server using Jenkins and a Mac Mini at our office, this has been working really well for the past couple of months. But the other week we started implementing Unity In-App Purchasing and the builds started to fail. The reason they fail is because Unity services(Analytics and In-App) seems to not get activated when starting unity from the “commandline”. I’ve tested a lot of things and checked that all the settings is saved correct in the “UnityConnectSettings.asset” file.

  1. If i open the project manually on the build server(Mac mini), everything is correct i.e Analytics and In-App is activated and i can build manually

  2. If i start a build using Jenkins with these command line arguments
    -quit -batchmode -serial SB-XX-XXXX-XXXX-XXXX-XXXX-XXXX-username “mail@gmail.com” -password “XXXXXXX” -executeMethod AutoBuilder.CommandLineBuild -nographics -projectPath “/Users/Shared/Jenkins/Home/workspace/XXXXXXXX/XXXXXXX”

The build fails because all classes that reference any part of the In-App system fails to recognize the classes that are part of it.

Below is the “error” part of the log file, but i’m also attaching the full log

-----CompilerOutput:-stdout–exitcode: 1–compilationhadfailure: True–outfile: Temp/Assembly-CSharp-firstpass.dll
Compilation failed: 29 error(s), 0 warnings
-----CompilerOutput:-stderr----------
Assets/Plugins/UnityPurchasing/script/IAPButton.cs(21,54): error CS0246: The type or namespace name Product' could not be found. Are you missing SA.IOSNative.StoreKit’ using directive?
Assets/Plugins/UnityPurchasing/script/IAPButton.cs(24,51): error CS0246: The type or namespace name Product' could not be found. Are you missing SA.IOSNative.StoreKit’ using directive?
Assets/Plugins/UnityPurchasing/script/IAPButton.cs(24,60): error CS0246: The type or namespace name PurchaseFailureReason' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(161,40): error CS0246: The type or namespace name IStoreListener’ could not be found. Are you missing an assembly reference?
Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(24,39): error CS0246: The type or namespace name IStoreListener' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(124,10): error CS0246: The type or namespace name PurchaseProcessingResult’ could not be found. Are you missing an assembly reference?
Assets/Plugins/UnityPurchasing/script/IAPButton.cs(136,33): error CS0246: The type or namespace name Product' could not be found. Are you missing SA.IOSNative.StoreKit’ using directive?
Assets/Plugins/UnityPurchasing/script/IAPButton.cs(136,50): error CS0246: The type or namespace name PurchaseFailureReason' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(167,14): error CS0246: The type or namespace name IStoreController’ could not be found. Are you missing an assembly reference?
Assets/Plugins/UnityPurchasing/script/IAPButton.cs(168,14): error CS0246: The type or namespace name IExtensionProvider' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(198,11): error CS0246: The type or namespace name IStoreController’ could not be found. Are you missing an assembly reference?
Assets/Plugins/UnityPurchasing/script/IAPButton.cs(204,11): error CS0246: The type or namespace name IExtensionProvider' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(220,11): error CS0246: The type or namespace name Product’ could not be found. Are you missing SA.IOSNative.StoreKit' using directive? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(248,31): error CS0246: The type or namespace name IStoreController’ could not be found. Are you missing an assembly reference?
Assets/Plugins/UnityPurchasing/script/IAPButton.cs(248,60): error CS0246: The type or namespace name IExtensionProvider' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(258,36): error CS0246: The type or namespace name InitializationFailureReason’ could not be found. Are you missing an assembly reference?
Assets/Plugins/UnityPurchasing/script/IAPButton.cs(263,11): error CS0246: The type or namespace name PurchaseProcessingResult' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(273,34): error CS0246: The type or namespace name Product’ could not be found. Are you missing SA.IOSNative.StoreKit' using directive? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(273,51): error CS0246: The type or namespace name PurchaseFailureReason’ could not be found. Are you missing an assembly reference?
Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(27,10): error CS0246: The type or namespace name IStoreController' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(28,10): error CS0012: The type UnityEngine.Purchasing.IStoreExtension’ is defined in an assembly that is not referenced. Consider adding a reference to assembly UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' /Users/Shared/Jenkins/Home/workspace/BadMenRelease/BadMen/Assets/Plugins/UnityPurchasing/Bin/Stores.dll (Location of the symbol related to previous error) Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(55,28): error CS0246: The type or namespace name IStoreController’ could not be found. Are you missing an assembly reference?
Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(55,57): error CS0246: The type or namespace name IExtensionProvider' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(116,9): error CS0246: The type or namespace name PurchaseProcessingResult’ could not be found. Are you missing an assembly reference?
Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(200,31): error CS0246: The type or namespace name Product' could not be found. Are you missing SA.IOSNative.StoreKit’ using directive?
Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(200,45): error CS0246: The type or namespace name PurchaseFailureReason' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(208,33): error CS0246: The type or namespace name InitializationFailureReason’ could not be found. Are you missing an assembly reference?
Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(340,26): error CS0246: The type or namespace name Product' could not be found. Are you missing SA.IOSNative.StoreKit’ using directive?
Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(345,34): error CS0246: The type or namespace name Product' could not be found. Are you missing SA.IOSNative.StoreKit’ using directive?
-----EndCompilerOutput---------------

  • Finished compile Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll
    Assets/Plugins/UnityPurchasing/script/IAPButton.cs(21,54): error CS0246: The type or namespace name Product' could not be found. Are you missing SA.IOSNative.StoreKit’ using directive?
    Assets/Plugins/UnityPurchasing/script/IAPButton.cs(24,51): error CS0246: The type or namespace name Product' could not be found. Are you missing SA.IOSNative.StoreKit’ using directive?
    Assets/Plugins/UnityPurchasing/script/IAPButton.cs(24,60): error CS0246: The type or namespace name PurchaseFailureReason' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(161,40): error CS0246: The type or namespace name IStoreListener’ could not be found. Are you missing an assembly reference?
    Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(24,39): error CS0246: The type or namespace name IStoreListener' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(124,10): error CS0246: The type or namespace name PurchaseProcessingResult’ could not be found. Are you missing an assembly reference?
    Assets/Plugins/UnityPurchasing/script/IAPButton.cs(136,33): error CS0246: The type or namespace name Product' could not be found. Are you missing SA.IOSNative.StoreKit’ using directive?
    Assets/Plugins/UnityPurchasing/script/IAPButton.cs(136,50): error CS0246: The type or namespace name PurchaseFailureReason' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(167,14): error CS0246: The type or namespace name IStoreController’ could not be found. Are you missing an assembly reference?
    Assets/Plugins/UnityPurchasing/script/IAPButton.cs(168,14): error CS0246: The type or namespace name IExtensionProvider' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(198,11): error CS0246: The type or namespace name IStoreController’ could not be found. Are you missing an assembly reference?
    Assets/Plugins/UnityPurchasing/script/IAPButton.cs(204,11): error CS0246: The type or namespace name IExtensionProvider' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(220,11): error CS0246: The type or namespace name Product’ could not be found. Are you missing SA.IOSNative.StoreKit' using directive? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(248,31): error CS0246: The type or namespace name IStoreController’ could not be found. Are you missing an assembly reference?
    Assets/Plugins/UnityPurchasing/script/IAPButton.cs(248,60): error CS0246: The type or namespace name IExtensionProvider' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(258,36): error CS0246: The type or namespace name InitializationFailureReason’ could not be found. Are you missing an assembly reference?
    Assets/Plugins/UnityPurchasing/script/IAPButton.cs(263,11): error CS0246: The type or namespace name PurchaseProcessingResult' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(273,34): error CS0246: The type or namespace name Product’ could not be found. Are you missing SA.IOSNative.StoreKit' using directive? Assets/Plugins/UnityPurchasing/script/IAPButton.cs(273,51): error CS0246: The type or namespace name PurchaseFailureReason’ could not be found. Are you missing an assembly reference?
    Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(27,10): error CS0246: The type or namespace name IStoreController' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(28,10): error CS0012: The type UnityEngine.Purchasing.IStoreExtension’ is defined in an assembly that is not referenced. Consider adding a reference to assembly UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(55,28): error CS0246: The type or namespace name IStoreController’ could not be found. Are you missing an assembly reference?
    Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(55,57): error CS0246: The type or namespace name IExtensionProvider' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(116,9): error CS0246: The type or namespace name PurchaseProcessingResult’ could not be found. Are you missing an assembly reference?
    Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(200,31): error CS0246: The type or namespace name Product' could not be found. Are you missing SA.IOSNative.StoreKit’ using directive?
    Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(200,45): error CS0246: The type or namespace name PurchaseFailureReason' could not be found. Are you missing an assembly reference? Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(208,33): error CS0246: The type or namespace name InitializationFailureReason’ could not be found. Are you missing an assembly reference?
    Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(340,26): error CS0246: The type or namespace name Product' could not be found. Are you missing SA.IOSNative.StoreKit’ using directive?
    Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(345,34): error CS0246: The type or namespace name Product' could not be found. Are you missing SA.IOSNative.StoreKit’ using directive?
  • Finished compile Library/ScriptAssemblies/Assembly-UnityScript-firstpass.dll

3063031–230199–JenkinsLog.txt (716 KB)

So i managed to solve this. The actual reason it has started to fail was that the build server had cleaned and pulled the entire project again, and for some reason it did not switch to iOS platform before building. I added -buildTarget “ios” to the command line arguments to make sure it always opens with iOS buildtarget set.