I have a flutter app and its working fine in debug mode but when i run flutter build apk command for android apk it shows the following error.
The error is cannot run with sound null safety.
Error:
C:\Users\RAILO\flutter\bin\flutter.bat --no-color build apk
Building with sound null safety
Running Gradle task 'assembleRelease'...
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
- package:flutter_swiper
- package:flutter_page_indicator
- package:transformer_page_view
For solutions, see https://dart.dev/go/unsound-null-safety
FAILURE: Build failed with an exception.
Add this line on top of main.dart
// #dart=2.9
then run $flutter clean && flutter pub get
you can try this command also.
flutter build apk --release --no-sound-null-safety
Related
i'm having some problems while compiling my flutter app for Android.. I've only 3 assets and a couple packages added, but when I try to compile, I got this:
√ Built build\app\outputs\flutter-apk\app-release.apk (158.3MB).
Any idea?
Flutter build log (running flutter build apk)
PS C:\\Users\\Admin\\Desktop\\Fictix\\Don't Touch This\\app\\dtt_app\> flutter build apk
Building with sound null safety
First of all, you can try clearing the cache via terminal.
flutter clean
This command will delete few temporary folders, specially "build/", ".dart_tools/" and ".packages/".
You can also run the following code from the terminal before the build phase of your application.
flutter build appbundle --target-platform android-arm,android-arm64
Of course, it is not a 100% method, but it can work in reducing your application size.
You can follow the steps below to clear it by Android Studio.
Tools > Flutter > Flutter Clean
Make your app with no sound null safety
From Terminal Run This Command
flutter build apk --split-per-abi --no-sound-null-safety
or
flutter build apk --release --no-sound-null-safety
If your problem still persists
// #2.9 in the top remove the parameter from Const app_name();
Run --no-sound-null-safety from terminal
Edit your Configure File and write in Additional run args:- --no-sound-null-safety
I have a flutter project and I wanted to get an apk for the app I tried flutter build apk command and I got this error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageRelease'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
> SigningConfig "release" is missing required property "storeFile".
I've tried this command flutter build apk --release but I also got the same error.
I also searched and tried different solutions but nothing fixed the issue.
General-ish solution that could work for you:
Try flutter clean and then flutter pub get.
If that doesn't work, you can try upgrading your Flutter SDK like so: flutter upgrade.
You can also run flutter doctor to see a list of possible issues with your code.
After running the set of commands, then try building the .apk.
I've been trying to build an apk for my app but its failing and I don't understand why
this is what is shwoing
i tried to build using this command that was given to me in comments
flutter build apk --no-tree-shake-icons
but its showing me this new error now
Try add this when build your apk --no-tree-shake-icons
Generally, for errors that seem odd like this, running flutter clean then flutter pub get in the terminal helps.
I'm about to release my Flutter app.
https://flutter.dev/docs/deployment/obfuscate
I read the above page and ran the following command in a terminal, but I get an error.
flutter build appbundle --obfuscate --split-debug-info /projectName/odf
↓error contents
* Where:
Script '/Users/userno1/dev2/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1035
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command '/Users/userno1/dev2/flutter/bin/flutter'' finished with non-zero exit value 1
flutter build appbundle
With the above command, the release build was successful.
I'd like to somehow obfuscate the source code, which is the result of my efforts.
Is there any good way?
You're incorrectly using the command:
flutter build appbundle --obfuscate --split-debug-info /projectName/odf
because you're missing the = after --split-debug-info
Try the following command:
flutter build appbundle --obfuscate --split-debug-info=your_debug_info_directory
Where your_debug_info_folder is a directory in your project
When I try ionic cordova build android --prod --release command in Ionic 3, it shows an error
[12:24:50] ionic-app-script task: “build”
[12:24:50] Error: The Angular AoT build failed. See the issues above
Error: The Angular AoT build failed. See the issues above
at /Users/angelamal/Documents/osome/node_modules/#ionic/app-scripts/dist/aot/aot-compiler.js:237:55
at step (/Users/angelamal/Documents/osome/node_modules/#ionic/app-scripts/dist/aot/aot-compiler.js:32:23)
at Object.next (/Users/angelamal/Documents/osome/node_modules/#ionic/app-scripts/dist/aot/aot-compiler.js:13:53)
at fulfilled (/Users/angelamal/Documents/osome/node_modules/#ionic/app-scripts/dist/aot/aot-compiler.js:4:58)
[ERROR] An error occurred while running subprocess ionic-app-scripts.
ionic-app-scripts build --prod --target cordova --platform android exited
with exit code 1.
While I try to build an android app in Ionic 3.
I used this command ionic cordova build android --prod --release
But it is showing an error. How to solve this?
Thanks in Advance