简体   繁体   中英

Flutter Gradle task assembleDebug failed with exit code 1

I am trying to run flutter project on my phone but I get this exception:

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 find com.android.tools.build:gradle:4.1.3. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.pom - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.jar - https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.pom - https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.jar Required by: project:

  • 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 2s Exception: Gradle task assembleDebug failed with exit code 1

Please try the following steps:

  1. Delete the android directory.
  2. Run flutter clean comment
  3. Run flutter create. comment
  4. Run flutter pub get comment
  5. Run the application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM