Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obfuscating Dart code Error #67014

Closed
beingcoderr opened this issue Sep 30, 2020 · 5 comments
Closed

Obfuscating Dart code Error #67014

beingcoderr opened this issue Sep 30, 2020 · 5 comments

Comments

@beingcoderr
Copy link

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

Error result:

FAILURE: Build failed with an exception.                                
                                                                        
* Where:                                                                
Script '/opt/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 896
                                                                        
* What went wrong:                                                      
Execution failed for task ':app:compileFlutterBuildRelease'.            
> Process 'command '/opt/flutter/bin/flutter'' finished with non-zero exit value 1
                                                                        
* Try:                                                                  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
                                                                        
* Get more help at https://help.gradle.org                              
                                                                        
BUILD FAILED in 22s                                                     
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                      23.7s
Gradle task assembleRelease failed with exit code 1

flutter doctor output

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.4, on Linux, locale en_GB.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.49.2)
[!] Connected device
    ! No devices available

! Doctor found issues in 1 category
@jonahwilliams
Copy link
Member

flutter build apk --obfuscate --split-debug-info=/<project-name>/<directory> is not a valid command, you need to run something like flutter build apk --obfuscate --split-debug-info=debug_info

@beingcoderr

@jonahwilliams jonahwilliams added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds. label Sep 30, 2020
@beingcoderr
Copy link
Author

flutter build apk --obfuscate --split-debug-info=/<project-name>/<directory> is not a valid command, you need to run something like flutter build apk --obfuscate --split-debug-info=debug_info

@beingcoderr

Thanks it worked. I followed the following documentation.
https://flutter.dev/docs/deployment/obfuscate

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds. label Sep 30, 2020
@Faizan-sts
Copy link

flutter build apk --obfuscate --split-debug-info=debug_info command does complete without any error but after doing flutter install on a physical device, app installs but crash on the very begining.

Where as flutter build apk --obfuscate --split-debug-info=/<project-name>/<directory> again giving following error
`FAILURE: Build failed with an exception.

  • Where:
    Script 'C:\Programs\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildRelease'.

Process 'command 'C:\Programs\flutter\bin\flutter.bat'' finished with non-zero exit value 1

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 20s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 21.3s
Gradle task assembleRelease failed with exit code 1`

Also Why this command flutter build apk --obfuscate --split-debug-info=/<project-name>/<directory> is not a valid command? As this exactly how it states on official flutter docs https://flutter.dev/docs/deployment/obfuscate

My flutter doctor output

[√] Flutter (Channel stable, 1.22.5, on Microsoft Windows [Version 10.0.17763.1697], locale en-GB) [!] Android toolchain - develop for Android devices (Android SDK version 30.0.2) X Android license status unknown. Run flutter doctor --android-licenses to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/windows#android-setup for more details. [√] Android Studio (version 4.0) [√] Connected device (1 available)

@pumuckelo
Copy link

@Faizan-sts did you manage to get it working?

flutter build apk --obfuscate --split-debug-info=/<project-name>/<directory> command can't work if you type it into your terminal like this.

You need to type flutter build apk --obfuscate --split-debug-info=./debug/debug for example to specify a path to the debug file

@github-actions
Copy link

github-actions bot commented Aug 5, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants