Building Android builds with 2018.x fail on a pre-2018 project

Hi. I’m developing an assetstore package and use unity cloud build extensively to build APKs in different Unity versions. The main project Unity version is 5.3, but cloud targets are set all the way up to 2018.2. Android builds work correctly on all targets up to 2017.4, but fail on 2018.1 and 2018.2 with the following error:

3678: [Unity] Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.323730 seconds (Nothing changed)
3679: [Unity] Refresh completed in 0.323769 seconds.
3680: Unhandled Exception: UnityEngine.UnityException: GetBool is not allowed to be called while application is terminating.
3681:   at <0x00000> <unknown method>
3682:   at <0x00000> <unknown method>
3683:   at <0x00000> <unknown method>
3684:   at <0x00000> <unknown method>
3685: [Unity] Cleanup mono

(I can share the whole full log if requested)

It also says that there’s an error opening an ivy.xml for Built-in Facebook SDK (which I don’t even use), but I don’t think it’s a culprit.
It seems that it tries to open the headless mode after closing it for some reason, but fails in the process due to that strange bug - Is there a Closing Editor Change between beta 9 and beta 10?

Is there a workaround for cloud builds on this?

2 Likes

Having similar problem as well, causing us not able to run unit test due to this error.

1 Like

Was this fixed? suffering from this issue as well (2018.2.2f1)

Not sure if you’re using Jenkins to run the unit test, here is the way we temporary solve it in our company for now, we force it to return true no matter how after running the unit test, the only draw back for now is that it will attempt to build the project then fail the build process if unit test is failing.

"/Applications/Unity/Hub/Editor/2018.2.11f1/Unity.app/Contents/MacOS/Unity" -projectPath "${WORKSPACE}" -batchmode -nographics -runEditorTests -editorTestsResultFile "${WORKSPACE}/build/test-reports/test_result_build_${BUILD_NUMBER}.xml" || true

Bumping this thread. Anyone find a cause or more permanent solution?

I have just setup a completely custom CI solution on one of my machines and now build everything using discord bot commands. Build times also improved significantly (it used to take an hour to build an Android build on Unity Cloud, now it takes 3 minutes). I don’t use Jenkins or other systems, it’s pretty bare-bones and hacked-up together, but I haven’t faced any issues so far.

I highly recommend investing some time into building a custom CI solution, it’s really worth it.