skip to Main Content

Recently I’ve started learning mobile apps development using flutter. However, I’m still facing this error. Whenever I try to run my app it takes kinda long time to load and then it shows me this error:

Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not download bundletool-0.14.0.jar (com.android.tools.build:bundletool:0.14.0)
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/0.14.0/bundletool-0.14.0.jar'.
         > Premature end of Content-Length delimited message body (expected: ?????????; received: ?????????)
   > Could not download kotlin-compiler-embeddable-1.3.50.jar (org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.50)
      > Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.3.50/kotlin-compiler-embeddable-1.3.50.jar'.
         > Premature end of Content-Length delimited message body (expected: ??????????; received: ?????????)

* 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 26m 32s
Running Gradle task 'assembleDebug'...
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not download bundletool-0.14.0.jar (com.android.tools.build:bundletool:0.14.0)
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/0.14.0/bundletool-0.14.0.jar'.
         > Premature end of Content-Length delimited message body (expected: ?????????; received: ???????)
   > Could not download kotlin-compiler-embeddable-1.3.50.jar (org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.50)
      > Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.3.50/kotlin-compiler-embeddable-1.3.50.jar'.
         > Premature end of Content-Length delimited message body (expected: ??????????; received: ???????)

* 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
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception: Gradle task assembleDebug failed with exit code 1

It seems like there is some network issue -which is expected since I have a poor network connection-, so I tried to download the required .jar files manually. But I don’t know where I should place those files yet don’t know if that could fix this error.

any ideas?

2

Answers


  1. Chosen as BEST ANSWER

    This error occurred after solving network issue:

    Launching libmain.dart on sdk gphone x86 in debug mode...
    Running Gradle task 'assembleDebug'...
    F/crash_dump32(19734): crash_dump.cpp:474] failed to attach to thread 187: Permission denied
    F/crash_dump32(19800): crash_dump.cpp:474] failed to attach to thread 187: Permission denied
    F/crash_dump32(19936): crash_dump.cpp:474] failed to attach to thread 187: Permission denied
    F/crash_dump32(20268): crash_dump.cpp:474] failed to attach to thread 187: Permission denied
    F/crash_dump32(20411): crash_dump.cpp:474] failed to attach to thread 187: Permission denied
    E/AndroidRuntime(20060): FATAL EXCEPTION: SysUiBg
    E/AndroidRuntime(20060): Process: com.android.systemui, PID: 20060
    E/AndroidRuntime(20060): DeadSystemException: The system died; earlier logs will point to the root cause
    F/crash_dump32(22754): crash_dump.cpp:474] failed to attach to thread 187: Permission denied
    F/crash_dump32(24953): crash_dump.cpp:474] failed to attach to thread 187: Permission denied
    F/crash_dump32(25275): crash_dump.cpp:474] failed to attach to thread 187: Permission denied
    F/crash_dump32(25505): crash_dump.cpp:474] failed to attach to thread 187: Permission denied
    Parameter format not correct -
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:packageDebug'.
    > A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
       > com.android.ide.common.signing.KeytoolException: Failed to read key AndroidDebugKey from store "C:UsersHome.androiddebug.keystore": Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available
    
    * 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 31m 32s
    Exception: Gradle task assembleDebug failed with exit code 1
    

  2. The error message you’re seeing indicates that Gradle is having trouble downloading certain artifacts while building your Android project for your Flutter app. This can be caused by network issues, problems with the repositories, or specific Gradle configurations. To resolve this issue, you can try the following steps:

    Check Your Internet Connection:
    Ensure that you have a stable internet connection. Sometimes network issues can cause problems with downloading dependencies.
    Clear Gradle Cache:
    Gradle caches downloaded dependencies, and sometimes this cache can become corrupted. You can try clearing the Gradle cache by running the following command in your project’s root directory:

    1. flutter clean
    2. flutter run
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search