Execution failed for task ':path_provider:extractDebugAnnotations'

Viewed 4310

I've recently updated android studio and flutter (android studio version 3.6.1 and flutter SDK v1.12.13+hotfix.8). when I'm trying to run my previous project I'm facing the following Error:

Launching lib\main.dart on Google Nexus 5 0 in debug mode...
Running Gradle task 'assembleDebug'...


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':path_provider:extractDebugAnnotations'.
> Could not resolve all files for configuration ':path_provider:lintClassPath'.
   > Could not find lint-gradle.jar (com.android.tools.lint:lint-gradle:26.5.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle/26.5.0/lint-gradle-26.5.0.jar
   > Could not find lint.jar (com.android.tools.lint:lint:26.5.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint/26.5.0/lint-26.5.0.jar
   > Could not find lint-checks.jar (com.android.tools.lint:lint-checks:26.5.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-checks/26.5.0/lint-checks-26.5.0.jar
   > Could not find lint-api.jar (com.android.tools.lint:lint-api:26.5.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-api/26.5.0/lint-api-26.5.0.jar
   > Could not find intellij-core.jar (com.android.tools.external.com-intellij:intellij-core:26.5.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/26.5.0/intellij-core-26.5.0.jar
   > Could not find kotlin-compiler.jar (com.android.tools.external.com-intellij:kotlin-compiler:26.5.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/kotlin-compiler/26.5.0/kotlin-compiler-26.5.0.jar
   > Could not find uast.jar (com.android.tools.external.org-jetbrains:uast:26.5.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/external/org-jetbrains/uast/26.5.0/uast-26.5.0.jar

* 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 22s
Finished with error: Gradle task assembleDebug failed with exit code 1

this is the pubspec.yaml file

name: someproject
description: A new Flutter application.

version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  auto_size_text: ^2.1.0
  cupertino_icons: ^0.1.2
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  font_awesome_flutter: ^8.7.0
  flutter_custom_clippers: ^1.1.0
  http: ^0.12.0+4
  html_unescape: ^1.0.1+3
  path_provider: ^1.6.5
  sqflite: ^1.3.0



dev_dependencies:
  flutter_test:
    sdk: flutter


flutter:

  uses-material-design: true

  assets:

and here is my build.gradle

buildscript {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.google.com' }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

gradle.properties

org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

app\build.gradle

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "mojtaba.azmoonasli"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

flutter doctor

[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.720], locale en-US)
    • Flutter version 1.12.13+hotfix.8 at D:\FlutterSDK\flutter
    • Framework revision 0b8abb4724 (5 weeks ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\mojta\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-Q, build-tools 28.0.3
    • Java binary at: D:\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    X Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.

[√] Android Studio (version 3.6)
    • Android Studio at D:\Android Studio
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] Connected device (1 available)
    • Google Nexus 5 0 • 192.168.96.103:5555 • android-x86 • Android 5.0 (API 21)

! Doctor found issues in 1 category.

Thanks for your time ❤

5 Answers

well i tried the following and the issue was solved.

  1. in android studio open pubspec.yaml file and in the top of the window click on flutter Upgrade. Or download and install it from here: https://flutter.dev/docs/get-started/install/windows. enter image description here after updating flutter the problem should be solved.

  2. If didnt work deleted the flutter SDK and download it from https://flutter.dev/docs/get-started/install and run the project again.

  3. (not recommended) if the issue still consists you can delete everything including flutter, reinstall and changed to the stable channel and it should be fine again.

Following steps helped me:

-->upgrading Gradle .

-->run 'flutter clean'.

-->run 'flutter run'.

In your pubspec.yaml file execute pub upgrade command given at top right corner or in terminal run : flutter pub upgrade --major-versions and then rebuild projects hope it works for you.

In build.gradle file change

classpath 'com.android.tools.build:gradle:7.0.0'

with

classpath 'com.android.tools.build:gradle:4.1.0'

because classpath 'com.android.tools.build:gradle:7.1.0' is not supported anymore.

I had the same problem Connect with the internet and then debug the application it worked

Related