I’m having an issue since a couple of weeks : I can’t build anymore my Android app with the cloud build. With exactly the same version and exactly the same device, the editor build works great but I have the following error with the cloud build (read via logcat) : The file ‘/data/app/com.myCompany.myGame/base.apk/assets/bin/Data/sharedassets0.assets’ is corrupted! Remove it and launch unity again! [Position out of bounds!]
This message is repeated 9 times on the log. I have a similar message with level0.assets instead of sharedassets0.assets which is repeated twice. In the middle of those messages, I have the following error : A script behaviour (probably GameManager?) has a different serialization layout when loading. (Read 44 bytes but expected 32 bytes) Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
I checked, double checked, and triple checked my code (except my GooglePlayGames plugin, I have to admit), but I don’t have weird #ifdef case. It seems that it solved the problem on similar issues on the forum, but it doesn’t solve mine. Plus, once again, it happens only with the cloud build, so my guess would be the issue is related to it.
I just did and it seems that the version control was ignoring some DLL files which were necessary to build the project (the global git_ignore file is a pain, sometimes…). Anyway, locally I couldn’t even build without those DLL so I added them to the version control and it seems it works fine now, both for the cloud build and for any local repository.
I still don’t understand how the UCB could even build without those ignored files, but hey, now it works fine, so it’s all good.
When I build an apk in local, the application works fine.
But when I build an apk from Cloud Build, the build is a success, but the application stucks at launch and seems to not load the scene because of this message :
The file ‘path/to/file/Data/level0’ is corrupted! Remove it and launch unity again! [Position ouf of bounds!].
I did a checkout of the git branch I use for Cloud Build, in an empty folder, to test again the local build and it works too.
I’m using gradle build with IL2CPP scripting backend, and target architectures set to ARMv7 and ARM64 in Player Settings.
Unity version on my PC is 2017.4.34f1, but on Cloud Build it uses the 2017.4.33f1 as the latest 2017.4.
Didn’t remember exactly but I think I just ended up completely removing the project Library folder and then Unity rebuilt it when opening the project and that fixed it.
At your own risk though, make a backup or something, deleting the Library folder contents should be fine but you never know