Home > database >  Flutter FAILURE: Build failed with an exception app don't run
Flutter FAILURE: Build failed with an exception app don't run

Time:05-12

please help me. Since I reset my computer and installed flutter again. I keep getting this error and yet it's just flutter's default code, I didn't add anything.

*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 resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10.
         Required by:
             project :
          > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10.
             > Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.6.10/kotlin-gradle-plugin-1.6.10.pom'.
                > Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.6.10/kotlin-gradle-plugin-1.6.10.pom'.
                   > H�te inconnu (repo.maven.apache.org)
       > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72.
         Required by:
             project : > com.android.tools.build:gradle:4.1.0
             project : > com.android.tools.build:gradle:4.1.0 > com.android.tools.build:builder:4.1.0
             project : > com.android.tools.build:gradle:4.1.0 > com.android.tools.build:aaptcompiler:4.1.0
             project : > com.android.tools.build:gradle:4.1.0 > com.android.tools.lint:lint-gradle-api:27.1.0
             project : > com.android.tools.build:gradle:4.1.0 > com.android.tools.build:gradle-api:4.1.0

          > Could not resolve com.sun.activation:javax.activation:1.2.0.
             > Could not get resource 'https://repo.maven.apache.org/maven2/com/sun/activation/javax.activation/1.2.0/javax.activation-1.2.0.pom'.
                > Could not GET 'https://repo.maven.apache.org/maven2/com/sun/activation/javax.activation/1.2.0/javax.activation-1.2.0.pom'.
                   > repo.maven.apache.org
       > Could not resolve com.google.jimfs:jimfs:1.1.
         Required by:
             project : > com.android.tools.build:gradle:4.1.0 > com.android.tools.build:builder:4.1.0 > com.android.tools:sdklib:27.1.0 > com.android.tools:repository:27.1.0
          > Could not resolve com.google.jimfs:jimfs:1.1.
             > Could not get resource 'https://repo.maven.apache.org/maven2/com/google/jimfs/jimfs/1.1/jimfs-1.1.pom'.
                > Could not GET 'https://repo.maven.apache.org/maven2/com/google/jimfs/jimfs/1.1/jimfs-1.1.pom'.
                   > repo.maven.apache.org
    
    * 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 7s
    Running Gradle task 'assembleDebug'...                              9,9s
    [!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
    Exception: Gradle task assembleDebug failed with exit code 1*

This is result of flutter doctor flutter doctor

CodePudding user response:

As a first-effort sanity check... verify that the following is present in your Gradle build script's repositories { } block.

mavenCentral()

If it so happens that you've got that there already... I would bet next that you may have bad proxy settings, as it seems like there is a failure to retrieve the files from the Apache Maven repository. Beneath is the reason I'm leaning toward a networking issue.

Could not GET 'https://repo.maven.apache.org/maven2/com/google/jimfs/jimfs/1.1/jimfs-1.1.pom'.

Please verify that your proxy settings facilitate a successful internet connection.

If this is not a networking issue (which would surprise me...)

The next thing to try would be to delete your Gradle caches, in the event something has gone wrong there.

Somewhere on your disk, there exists a .gradle folder. On Linux, this is often found in the Home directory (press control h to reveal hidden files). BEWARE: THIS WILL DELETE ALL OF YOUR GRADLE CACHES, NOT JUST THOSE SPECIFIC TO THIS PROJECT... Delete everything found in

~/.gradle/caches/

and then restart your IDE / rebuild the Gradle project.

If the Gradle Daemon is the source of the problem, you can use:

gradle --stop

or

./gradlew --stop

If none of these suggestions work, please write back and I will continue to offer advice!

Furthermore, while it may not be your primary issue here (or even related to the failure)... FlutterDoctor is claiming that your Visual Studio installation is not complete.

CodePudding user response:

I have installed a VPN to solve the problem because i couldn't access repo.maven.apache.org in the browser.

  • Related