What symbols to upload to Play Store with Flutter and native obfuscation?

754 Views Asked by At

For an Android Flutter app, you can obfuscate the Dart code and the native Android code.

Obfuscate Dart code with the flags --obfuscate --split-debug-info=/path/to/place/symbols while building aab, apk, ipa or ios.

You can obfuscate the Android native app in the build.gradle at the app level

buildTypes {
        release {
            shrinkResources true 
            minifyEnabled true
        } 

Now, my doubt is what symbols do I have to upload to Google Play?

  1. The Dart obfuscation generates the files:
  • app.android-x64.symbols
  • app.android-arm64.symbols
  • app.android-arm.symbols

but there is no info in how to use them besides symbolizing a crash report file you downloaded to your computer

  1. According to skyllet's answer, you should compress the folders (each one consisting in a libapp.so and libflutter.so archive):
  • arm64-v8a
  • armeabi-v7a
  • x86_64

located at build\app\intermediates\merged_native_libs\release\out\lib into a *.zip and upload that zip to Google Play

  1. You can also bundle the native symbols in the aab following Taras Svidnytskyy's answer by downloading the NDK and configuring the build.gradle (app)
android.*.ndkVersion = "23.1.7779620" | 'your ndk version'
android.*.ndk.debugSymbolLevel = 'FULL' | 'TABLE' // Table for reduced symbols

Now, using 3), the size of the compressed native-symbols bundled with the AAB, which unfortunately I cannot download to compare, is 5kB in Google Play console.

Using 2), the size of the compressed zip having the 3 folders is 12MB.

I didn't find how to upload the symbols from 1), but they weight about 1MB (compressed)

So my understanding is that 2 and 3 should upload the same symbols, but comparing the sizes of the archives, that does not seem the case.

What is the correct way to upload the symbols map?

1

There are 1 best solutions below

0
On

I think you have to upload build\app\outputs\mapping\release\mapping.txt to Google Play Console