Doing flutter build apk --release --no-shrink
I get the .apk build created successfully and runs fine on physical device aswel.
I'm trying to obfuscate with following command, which is a recommended way on flutter docs, here.
flutter build apk --obfuscate --split-debug-info=/<project-name>/<directory>
Which fails and throws following
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
Here It was suggested to use flutter build apk --obfuscate --split-debug-info=debug_info
which makes the build process successful but after installing app crash on start.
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] 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)