How to provide symbols for obfuscated Flutter Android app bundles
Asked Answered
H

1

8

I have a Flutter app targeting Android. I used to build app bundle using this command:

flutter build appbundle --release 

I would then zip and upload native debug symbols from build\app\intermediates\merged_native_libs\release\out\lib folder.

I am trying to use obfuscation, so I have switched to this command:

flutter build appbundle --release --obfuscate --split-debug-info=./build/symbols

This works and it creates three files in my "build/symbols" folder:

  • app.android-arm.symbols
  • app.android-arm64.symbols
  • app.android-x64.symbols

When I zip these three files into symbols.zip file and use upload native debug symbols to the Play Store, they are rejected with this error:

The native debug symbols contain an unexpected file: app.android-x64.symbols. app.android-arm64.symbols. app.android-arm.symbols.

I can still upload symbols from build\app\intermediates\merged_native_libs\release\out\lib as before.

Can someone explain what is the difference between these two sets of symbol files and what should I use in my store submission?

Hylton answered 5/10, 2022 at 23:32 Comment(0)
O
9

I have been researching these topic and I got the difference.

There are 2 types of obfuscation in a flutter app:

  1. native libraries (java, kotlin, etc.) code
  2. dart libraries (all your dart code)

When you upload build\app\intermediates\merged_native_libs\release\out\lib to the play console, it is used to de-obfuscate the native libraries.
This zip is also called as native debug symbols.

So when a crash occurs by the native code, these symbols will be used to de-obfuscate the Stack-trace by the Play console.

Now on the other hand, *.symbols files created by the flutter command(in your case files in build/symbols folder) are debug symbols to de-obfuscate dart code.

They will be used to de-obfuscate Stack-trace related to a dart-code crash. You'll see these crashes in something like Firebase Crashlytics.

To upload these symbols to Firebase use the following command:

firebase crashlytics:symbols:upload --app=APP_ID PATH/TO/symbols

In your case PATH/TO/symbols will be build/symbols

Organometallic answered 16/4, 2023 at 6:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.