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

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

Related

[Flutter Error]-Execution failed for task ':app:compileFlutterBuildDebug'

I recently formatted my pc and upgraded to windows 11.When I try to run my flutter app on my mobile phone,I get this error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Failed to create parent directory 'C:\Users\HP' when creating directory
'C:\Users\HP\Desktop\OWASLO\care_receiver_app\ss_carereceiver_app\android\app\build\intermed iates\flutter\debug\flutter_assets'
* 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 56s
Exception: Gradle task assembleDebug failed with exit code 1
the path mentioned in the error log
C:\Users\HP\Desktop\OWASLO\care_receiver_app\ss_carereceiver_app\android\app\build\intermed
iates\flutter\debug\flutter_assets
is where my app was before I formatted and
"C:\Users\HP"
was the user name before the laptop was formatted.
The app works fine on chrome but wont work on mobile.
Please help!!!

"the device is not ready" when running Flutter app

I install latest version of flutter on windows 10 and when I want to run app with VScode or Android Studio, I get this error:
FAILURE: Build failed with an exception.
* What went wrong:
java.io.IOException: the device is not ready
* 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
Exception: Gradle task assembleDebug failed with exit code 1
I already try flutter pub cache repair and flutter clean but that did not work.
run these commands:
flutter clean
flutter pub get

Gradle task assembleDebug failed error on running flutter app

Trying to run my app in my mobile phone error mentioned below. A simple login app and tried to run in web and successfully completed. I getting error
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
You need to accept the licenes from Android to run the app:
run: flutter doctor --android-licenses

Flutter build failed with exception

When I tried to run a flutter project it shows
BUILD FAILED WITH EXCEPTION
user1#user MINGW64 /c/src/projects/app
$ flutter run
Launching lib\main.dart on Samsung Galaxy S3 in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
Where:
Build file 'C:\src\projects\app\android\build.gradle' line: 8
What went wrong:
A problem occurred evaluating root project 'android'.
Could not create service of type ComponentMetadataSupplierRuleExecutor using DependencyManagementBuildScopeServices.createComponentMetadataSupplierRuleExecutor().
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 55s
Running Gradle task 'assembleDebug'... 77.7s
Gradle task assembleDebug failed with exit code 1
Can anyone tell why this happens, and how I can fix it, please?

can not generate flutter apk file

I'm trying to generate flutter apk file using the following command
flutter build apk --target-platform=android-arm
but I've got the following error
FAILURE: Build failed with an exception.
What went wrong:
Could not resolve all files for configuration ':app:releaseCompileClasspath'.
Could not download flutter_embedding_release.jar (io.flutter:flutter_embedding_release:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c)
Could not get resource 'http://download.flutter.io/io/flutter/flutter_embedding_release/1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c/flutt
er_embedding_release-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.jar'.
Read timed out
Could not download armeabi_v7a_release.jar (io.flutter:armeabi_v7a_release:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c)
Could not get resource 'http://download.flutter.io/io/flutter/armeabi_v7a_release/1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c/armeabi_v7a
_release-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.jar'.
Read timed out
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 insigh
ts.
Get more help at https://help.gradle.org
BUILD FAILED in 1m 3s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 64.6s
Gradle task assembleRelease failed with exit code 1
how to solve this problem ??