IL2CPP: C++ compiler config "Release" makes app freeze

606 views Asked by At

I am facing severe problems with building my app "VolarPro" using IL2CPP.

My test setup: Unity: 2020.3.3f1 Device: Samsung Galaxy Tab S3 Tablet Android Version: 9

Details: I have developed a simulation game targeting Android OS. The game logic is on the main thread, the simulation part (ODE solvers) is running on a seperate thread.

The app is now ready and should be published in Google Play Store. Due to Google's 64 bit policy I am now forced to build my app using IL2CPP instead of Mono.

App works perfectly fine when built with Mono on all devices I tested.

Building the app using IL2CPP works (.apk + .obb extension file, ARMv7+ARM64). Running the app however fails.

If I have C++ compiler configuration set to "Release", the app starts, but freezes immediately/GUI is not responsive, however I can hear the background sound playing. I could figure out now that the main thread freezes in Release build, while the simulation thread keeps running properly. Only errors Logcat shows are:

30958 30958 Error Zygote isWhitelistProcess - Process is Whitelisted 30958 30958 Error Zygote accessInfo : 1 30958 30958 Error eering.VolarPro Not starting debugger since process cannot load the jdwp agent.

If I have C++ compiler configuration set to "Debug", the app starts and GUI is responsive. So far so good. However, I see execution is pretty slow and very weirdly game physics behave very differently from the Mono build. Logcat does not show errors.

I really would appreciate any advice on what could cause the problem or how the debug this issue:

  • Are there any pitfalls on having the simulation on a separate thread that only shows on IL2CPP?
  • Could it be I use .NET methods that are not compatible with IL2CPP?
  • What mechanisms are there that would cause a freeze on a release build but not on a debug build?
  • Why is the game physics feeling different when using IL2CPP compared to Mono?
  • Any advice on build settings I should try out? (Incremental GC, Code Stripping, etc.)
  • Are there any workarounds? E.g. making the final build in Android Studio?

So I am in a state of deep despair and confusing. Any help on how to get my app running would be highly appreciated!

Thank you.

0

There are 0 answers