Flutter error when build appbundle (Script '/Users/****/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 991) - flutter

My app is running very well in debug mode. Now I am trying to build an appbundle for release, but have error.
Oops; flutter has exited unexpectedly: "Invalid argument(s): Cannot find executable for /Users//Developer/flutter/bin/cache/artifacts/engine/android-arm64-release/darwin-x64/gen_snapshot.".
A crash report has been written to /Users//AndroidStudioProjects/*********/flutter_04.log.
This crash may already be reported. Check GitHub for similar crashes.
https://github.com/flutter/flutter/issues?q=is%3Aissue+Invalid+argument%28s%29%3A+Cannot+find+executable+for+%2FUsers%2F*****%2FDeveloper%2Fflutter%2Fbin%2Fcache%2Fartifacts%2Fengine%2Fandroid-arm64-release%2Fdarwin-x64%2Fgen_snapshot.
To report your crash to the Flutter team, first read the guide to filing a bug.
https://flutter.dev/docs/resources/bug-reports
Create a new GitHub issue by pasting this link into your browser and completing the issue template. Thank you!
https://git.io/JO1nF
FAILURE: Build failed with an exception.
Where:
Script '/Users/****/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 991
What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
Process 'command '/Users/*****/Developer/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 58s
Running Gradle task 'bundleRelease'...
Running Gradle task 'bundleRelease'... Done 58.8s
Gradle task bundleRelease failed with exit code 1
I don't nkow what to do. Thanks for those who can suggest me something.

I was able to build appbundle by running in the terminal
flutter upgrade -f
flutter channel master
flutter upgrade
But I am facing another problem: when I run in release mode, it stuck at this
Installing build/app/outputs/flutter-apk/app.apk...

Related

FAILURE: Build failed with an exception. * Where: Script gradle\flutter.gradle' line: 1165

I developed an application using the flutter web emulator, after the application was finished I made it I want to run to the Android emulator, but there is an error like this
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\Denis\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1165
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\Users\Denis\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 12s
Exception: Gradle task assembleDebug failed with exit code 1
previously the error was on line 1005, then I did a flutter upgrade and now the error is on line 1165
The error message you received is not very specific and can occur due to various reasons. However, the fact that the error message is referring to Gradle suggests that there is an issue with the build process of your application. Here are a few steps that you can follow to try and resolve the issue:
Check the logs: When you run the 'flutter run' command, you should see a log output in your terminal or console. Look for any error messages that may provide more details about the issue.
Clean the project: Sometimes, cleaning the project can help resolve build issues. To do this, run the following commands:
flutter clean
flutter pub get
Update dependencies: Make sure that all dependencies in your pubspec.yaml file are up to date. You can do this by running the following command:
flutter pub upgrade
Check your code: Look for any errors in your code that may be causing the build to fail. Check the line number mentioned in the error message and see if there are any issues with the code on that line. 5. Check your Gradle configuration: If none of the above steps work, you may need to check your Gradle configuration. Make sure that you have the latest version of Gradle installed and that your build.gradle file is correctly configured. If you are still unable to resolve the issue, try searching for the error message online or consider seeking help from the Flutter community or support.

build apk working in flutter but run in emulator dose not work

i download flutter yesterday and make a project by flutter create command
i had problem in the build and run at first but i follow the instructions of https://docs.flutter.dev/deployment/android
then i build the app and try it in my phone and it work
but when i try to run the app in my phone by usb or in the emulator the same error happend
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:validateSigningDebug'.
java.util.concurrent.ExecutionException: com.android.builder.utils.SynchronizedFile$ActionExecutionException: java.io.IOException: com.android.ide.common.signing.KeytoolException: Failed to create keystore.
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 6s
Exception: Gradle task assembleDebug failed with exit code 1
i tried the solve of the website above

Problem debugging and running an App in Flutter (VSCode)

FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\Admin\OneDrive\Documentos\flutter-projects\hello_world\android\build.gradle' line: 15
What went wrong:
Could not compile build file 'C:\Users\Admin\OneDrive\Documentos\flutter-projects\hello_world\android\build.gradle'.
startup failed:
build file 'C:\Users\Admin\OneDrive\Documentos\flutter-projects\hello_world\android\build.gradle': 15: token recognition error at: '#' # line 15, column 35.
keyPassword = "qwert%$##!"
^
1 error
2
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 1m 43s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
have you clean your gradle with ./gradlew clean, run this command in your android directory project and then try ./gradlew build, if build is unsuccessful then try to looking at the log and see what's wrong with your project. based on my previous experience the problem is mostly from the outdated import, if that's the problem then try to update your package
Try to run these two commands:
flutter clean
flutter pub get
Please try upgrading your flutter first using flutter upgrade, then try cleaning your enviroment using flutter clean and then installing all the packages again using flutter pub get. This might fix your issue, you can try debugging your application again.

how to solve "Execution failed for task ':app:compileFlutterBuildDebug"

I was trying to run my Flutter app and this shows up:
I do flutter clean, I delete pubspec.lock
FAILURE: Build failed with an exception.
Where:
Script '/Users/mac/development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1005
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command '/Users/mac/development/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 21s
Exception: Gradle task assembleDebug failed with exit code 1
It seems that you missed running pub get after running flutter clean. Build task issues similar to what you've encountered could be usually solved by running flutter clean to clear the project's build cache and running flutter pub get to fetch the project's dependencies configured in the project's pubspec.yaml
Delete android/app/build folder and run flutter clean
worked for me.. :)

Flutter Update issues

My flutter code works perfectly fine and I have run multiple tests on it.
I just decided to install the new VS code updates and restart my VS code application.
All of the sudden I started having the error below and I have searched the entire code for the method but none was found
Launching lib\main.dart on Android SDK built for x86 in debug mode...
lib\main.dart
../../../flutter_windows_1.22.3-stable/flutter/packages/flutter/lib/src/widgets/navigator.dart:3783:32: Error: Getter not found: 'deoNotPop'.
case RoutePopDisposition.deoNotPop:
^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\temp\flutter_windows_1.22.3-stable\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\temp\flutter_windows_1.22.3-stable\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 1m 26s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
Someone, please help me
It looks like you may have inadvertedly modified a Flutter SDK file:
flutter/packages/flutter/lib/src/widgets/navigator.dart
case RoutePopDisposition.deoNotPop:
This should say doNotPop and not doeNotPop. Removing the e and saving the file should fix it. You can run git status in your Flutter SDK to see if there are other changes that may need reverting.