Gman256
Gman256

Reputation: 33

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.

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 :

BUILD FAILED in 2s Exception: Gradle task assembleDebug failed with exit code 1

Upvotes: 0

Views: 173

Answers (1)

Ashok Kuvaraja
Ashok Kuvaraja

Reputation: 716

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.

Upvotes: 0

Related Questions