Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use --split-debug-info=/<project-name>/<directory>

Tags:

flutter

In the command below, how to use --split-debug-info=/<project-name>/<directory>

flutter build apk --obfuscate --split-debug-info=/<project-name>/<directory>

When I declare project-name & directory path then the path contains nothing after build.

The --split-debug-info flag specifies the directory where Flutter can output debug files. This command generates a symbol map.

So the directory defined, but where are the resulted symbol maps?

like image 977
rozerro Avatar asked May 23 '20 18:05

rozerro


4 Answers

A reasonable value would be:

--split-debug-info=build/app/outputs/symbols

This puts it into a logical place near where the actual result files would appear, anyway.

like image 66
Gábor Avatar answered Oct 26 '22 23:10

Gábor


First of all, make sure you are using a version of Flutter framework >= 1.16.2, you can check it by running:

flutter --version

And if it's not the case, you can upgrade the Flutter framework by running:

flutter upgrade

Then, in order to generate the symbol map files when you run the flutter build command, you can use the command like this:

 flutter build apk --obfuscate --split-debug-info=some_parent_directory/some_child_directory

Note that some_parent_directory and some_child_directory are arbitrary names that you can replace for whatever you want.

Also note that there's no slash (/) symbol at the beggining of the right side of the equals (=) symbol of the --split-debug-info=some_parent_directory/some_child_directory part of the command.

For the example above, after the command finishes, you can find a some_parent_directory directory under your project's root directory, which contains another directory called some_child_directory which finally contains the symbol map files:

  • app.android-arm.symbols
  • app.android-arm64.symbols
  • app.android-x64.symbols
like image 31
SaloGala Avatar answered Oct 27 '22 00:10

SaloGala


The ideal directory would be : build/app/outputs/symbols

So :

--split-debug-info=build/app/outputs/symbols

The /<directory> can also be replaced with the relative path of the project or exact location.

Ex: ./ProjectFolderName/output

It will create ProjectFolderName folder inside your project directory

or

/Users/apple/Desktop/items/example

It will be specific path of folder

like image 41
Kabirou Agouda Avatar answered Oct 27 '22 01:10

Kabirou Agouda


It is recommended if you are going to upload it on Play Store.

flutter build appbundle --target-platform android-arm,android-arm64,android-x64
like image 43
Suvam Prasad Avatar answered Oct 27 '22 00:10

Suvam Prasad