can not generate flutter apk file - flutter

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 ??

Related

flutter build apk --split-per-abi errors

I want help configuring the apk file I see this message
code flutter build apk --split-per-abi
Is there anyone to help me with this problem and thank you in advance
PS C:\Users\deuts\OneDrive\Bureau\vox\NewsPro v2.1.0\newspro\news_pro> flutter build apk --split-per-abi
Building with sound null safety
error: error reading C:\Users\deuts\.gradle\caches\modules-2\files-2.1\androidx.lifecycle\lifecycle-common-java8\2.4.0-beta01\5b8f86fea035328fc9e8c660773037a3401ce25f\lifecycle-common-java8-2.4.0-beta01.jar; zip END header not found
error: error reading C:\Users\deuts\.gradle\caches\modules-2\files-2.1\androidx.lifecycle\lifecycle-common\2.4.0-beta01\1fdb7349701e9cf2f0a69fc10642b6fef6bb3e12\lifecycle-common-2.4.0-beta01.jar; zip END header not found
C:\Users\deuts\OneDrive\Bureau\vox\NewsPro v2.1.0\newspro\news_pro\build\better_player\generated\source\buildConfig\release\com\jhomlala\better_player\BuildConfig.java:4: error: cannot access com.jhomlala.better_player
package com.jhomlala.better_player;
^
zip END header not found
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':better_player:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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 30s
Running Gradle task 'assembleRelease'... 32.5s
Gradle task assembleRelease failed with exit code 1
PS C:\Users\deuts\OneDrive\Bureau\vox\NewsPro v2.1.0\newspro\news_pro>

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

Flutter: When I run this code flutter build appbundle this error occurs

PS C:\Users\saikr\projects\Todo-Flutter-master> flutter build appbundle
Building with sound null safety
Removed unused resources: Binary resource data reduced from 36KB to 28KB: Removed 21%
FAILURE: Build failed with an exception.
What went wrong:
A problem was found with the configuration of task ':app:signingConfigWriterRelease' (type 'SigningConfigWriterTask').
No value has been specified for property 'signingConfig.keyPassword'.
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 34s
Running Gradle task 'bundleRelease'... 95.7s
Gradle task bundleRelease failed with exit code 1
Anyone know how to solve this error? if so do let me know
try to create a new sign key, I think your sign key is broken

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 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?