Android Oxygene Obfuscation

I have an Android app written in Oxygene and published on the Google Play Store. My app crash report Stack Traces in the Google Play Console seem to indicate that the code has been obfuscated.

The stack traces look like this, for example:

java.lang.NullPointerException:
    at MyFileName.SomeObject.MethodName (Unknown Source: 56)
    at MyFileName.AnotherObject.NewMethodName (Unknown Source: 27)

Instead of this:

 java.lang.NullPointerException:
     at MyFileName.SomeObject.MethodName (MyFileName: 9231)
     at MyFileName.AnotherObject.NewMethodName (MyFileName: 3672)

In a typical Android project run via Android Studio and the standard toolchain, this is caused by ProGuard and can be fixed with the correct ProGuard settings or by uploading the mapping.txt file to the Play Console to deobfuscate (all described here).

Is EBuild obfuscating code in the build process? If so, is there a mapping.txt produced similarly to ProGuard?

thatā€™s not obfuscation, just lack of debug symbols?

This only seems to be an issue with the standard toolchain when obfuscation is enabled, so I was guessing that it may be the same cause in the EBuild toolchain. Is there any way in EBuild to see the actual error cause and line numbers in release builds?

obfuscation changes your actual method names. debug symbols associate your method names/binary code locations with source locations. thereā€™s an option to generate or not generate debug symbols (itā€™s on for Debug, off for Release, by default).

1 Like

I just ran across an issue with this. The Android manifest has a comment noting that the android:debuggable="true" attribute is overwritten by the compiler when the debug info option is set. The problem is that Iā€™m wanting my Release builds to generate debug symbols but not be debuggable.

Would it be possible to have android:debuggable="true" overridden if the build is set to Debug (not Release) rather than if the debug symbols are set to On?

hmm, iā€™m not sure if thatā€™s a feasible combo? what would this give you?

When an app in production crashes, I get the crash report with stack trace in the Google Play Developer Console. When debug symbols are turned off, the stack trace does not show the Exceptionā€™s message or the line numbers. Having this information available makes bug fixes significantly faster. For security reasons, the Google Play Store does not allow production apps to be marked debuggable (and I would not want production apps to be debuggable).

So I want my production apps to be NOT debuggable but to still show debug symbols in the crash reports. I donā€™t know how it works ā€œbehind the scenesā€ but it doesnā€™t seem like these should be mutually exclusive since Android apps built in Android Studio show the debug symbols in their crash reports.

gotcha. iā€™ll look into how to best expose thisā€¦

1 Like

Any update on this? It would be really nice to get readable stack traces from crashes in production.

Ah yes, lemme see if i can get the fix for this in today

Thanks, logged as bugs://82818

Ok, next build has a new AndroidAllowDebugging setting that drives the debuggable tag in the Manifest. If not set, I will default to the value of GenerateDebugSymbols and thus match the current behavior. But you can explicitly set it to ā€˜trueā€™ to allow debugging w.o symbols, or to ā€˜falseā€™ to disable debugging even though you ship symbols.

If this all works out well for you, next week Iā€™ll change the default template to have debug symbols true, debugging false set for Release, and both to true for Debug config.

1 Like

Fantastic! Thanks.

1 Like

bugs://82818 got closed with status fixed.