IAP Service not found running Batchmode (2017.3.0p3)

I’m not sure how to resolve this, but when I build the project directly in Unity (Mac) the Unity Services show that IAP is enabled and running and there are no build issues.

As soon as I try to build from the command line with -batchmode that same build is unable to verify that the IAP Services is active and the build fails wherever there is a Store reference.

Is there a new way to setup IAP when running in batch mode with 2017.3.0p4? This was working fine under 5.6.0f3.

Thanks

Can you share the build pipeline code that you are using to kick off a build?

I’m building with Jenkins (v2.89.3) running the “Invoke Unity3d Editor” with the following command line arguments:
-quit -batchmode -buildTarget iOS -serial ##### -username ##### -password ##### executeMethod Jenkins.PerformDeviOSBuild

I successfully use this same command, building the same code with Unity 5.6.0f3.

I am able to successfully build and run the code using the Editor, so I know the build works. But running from command line it appears Unity is unable to verify (include?) the IAP Service in order for the build to finish without errors.

I also just tried building it the same way using 2018.1.0b5 and I get the same results as using the 2017.3.0p4 version.

I get this warning when building from the command line (-batchmode). From the command line build Unity isn’t aware that IAP has been enabled in the Services window. When I launch the project in the Editor, the IAP service shows enabled.

-----CompilerOutput:-stderr----------
Assets/Plugins/UnityPurchasing/script/PurchasingCheck.cs(3,0): warning CS1030: #warning: `“Unity IAP plugin is installed, but Unity IAP is not enabled. Please enable Unity IAP in the Services window.”’
-----EndCompilerOutput---------------

I suspect the issue may be associated with the Jenkins user and permissions. These two posts may be relevant:

But why would it work, with the same Jenkins station, building with Unity 5.6.0f3 and not with 2018.1.0b (or 2017.xxx)? Are you suggesting that there’s a new permissions aspect to the Services that is preventing this with the latest version of Unity?

To clarify, Unity attempts to build the app, but the Services is not enabled during a command line batchmode build so the IAP file fires off errors because it can’t access the IAP content. Everything else Unity-wise builds except anything having to do with IAP Services (which is the only service that should be enabled).

@PGI2017 That is my understanding

This is getting ridiculous. Changing the user types didn’t change anything. Could this be a timing issue with Unity after launching where if it takes too long to connect and sync up the Services that it’s causing a continuation of the build to bail?

@PGI2017 That is possible, we are continuing to investigate.

Is it possible to introduce a delay right after Unity launches in batchmode to allow the Editor time to sync up Services?

@PGI2017 that is an area that we are investigating. Keep in mind that any fix for this would need to go through the release cycle for a future version of the Editor.

We’re returning to the older version of Unity until this is resolved.

Is there an expected release time for the next patch or full release?

We do not yet have an ETA for this issue.

Still exists in 2018 b7.

Are you able to test with 2017.2.2p1 or 2017.3.1p1 (or more recent patches) ? We pushed a fix in these patches which should address this issue.

This bug still exists in Unity2017.4.8f1, Unity2017.4.25f1 too.
If I use Unity in window mode, the ServiceWindow shows UnityIAP is Enabled.
However, using with batchmode, the editor log show an error below.

Assets/Plugins/UnityPurchasing/script/PurchasingCheck.cs(3,0): warning CS1030: #warning: `"Unity IAP plugin is installed, but Unity IAP is not enabled. Please enable Unity IAP in the Services window."

It seems to be connect Unity License Server to check whether UnityIAP is enabled when Unity.app works up.
But, in batchmode, this process doesn’t worked. So, build is failed.

Are there any solutions to be enable UnityIAP in batchmode ?

This bug still exists in Unity2018.3.9
We cannot integrated UnityIAP Unity Analytics. The error log is the same as KobayashiKeisuke

Please provide your batchmode syntax.

I’m also encountering this problem for both iOS and Android. Unity 2018.3.14f1.

Assets/Plugins/UnityPurchasing/script/PurchasingCheck.cs(3,0): warning CS1030: #warning: `“Unity IAP plugin is installed, but Unity IAP is not enabled. Please enable Unity IAP in the Services window.”

And this makes the IAP functionality not working in the final build.

My setup is Gitlab CI with self-hosted build machine.

I also think that this may relate to “Editor time to sync up Services” as other users said (?!)

This is the syntax:
/Applications/Unity/Hub/Editor/2018.3.14f1/Unity.app/Contents/MacOS/Unity -nographics -quit -batchmode -logFile -buildTarget Android -executeMethod Aegis.Build -projectPath xxxx -buildPlatform android -buildOutput xxxxxx -gameVersion 1.1.0 -gameBuildNumber 47