App compiled with Optimization Level Aggressive crash

Still working on test with my hello world app. It is very simple, just a couple of control with few lines of code
If I upload it to a test android phone (not emulator) and it is built with Optimization Level Aggressive it crashes with no message. Using Default level it works correctly
Could please someone more skilled verify it before create a report?

Same behaviour with Moderate level. Only Default works

On web, aggressive doesn’t work:
On macos, aggressive fails (at least some times):

Please create an Issue with this information so we can look into it.

Note that with Android, the Optimization setting works differently:

  • Default: Obfuscation: Off; Shrinking: Off
  • Moderate: Obfuscation: Off; Shrinking: On
  • Aggressive: Obfuscation: On; Shrinking: On

It sounds like the shrinking could be the culprit.

1 Like

Done. #73617

That’s not a clear (and really useful) way to users set what they want. You should consider having 3 separated switches keeping parameters as Android does:

Optimization: Default/Moderate/Aggressive
Obfuscation: ON/OFF
Shrinking: ON/OFF

Optimization is the use or not of R8 optimizations, at this point, moderate could be the same as Default, and aggressive would be using R8 “full mode” optimizations.
Obfuscation and Shrinking are obvious.

As for details on the incremental work done in R8, do a search for “R8 Optimization” here: Posts - Jake Wharton