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?
- 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
- 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
- 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?