25

I just cerate a empty application ,then when I run it on emulator ,error happend.

this error only arise when I run on android emulator , but ios works fine.

now I'm in the flutter beta channel.

so If anyone has any ideas , please let me know. thanks

here is the error log

Launching lib/main.dart on AOSP on IA Emulator in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
     Required by:
         project :app
      > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/flutter_embedding_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Could not GET 'http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/flutter_embedding_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
               > Connection reset
      > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/flutter_embedding_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Could not GET 'http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/flutter_embedding_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
               > Connection reset
      > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/flutter_embedding_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Could not GET 'http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/flutter_embedding_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
               > Connection reset
   > Could not resolve io.flutter:x86_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
     Required by:
         project :app
      > Could not resolve io.flutter:x86_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/x86_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Could not GET 'http://download.flutter.io/io/flutter/x86_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
               > Connection reset
      > Could not resolve io.flutter:x86_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/x86_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Could not GET 'http://download.flutter.io/io/flutter/x86_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
               > Connection reset
      > Could not resolve io.flutter:x86_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/x86_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Could not GET 'http://download.flutter.io/io/flutter/x86_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
               > Connection reset
   > Could not resolve io.flutter:x86_64_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
     Required by:
         project :app
      > Could not resolve io.flutter:x86_64_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/x86_64_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_64_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Could not GET 'http://download.flutter.io/io/flutter/x86_64_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_64_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
               > Connection reset
      > Could not resolve io.flutter:x86_64_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/x86_64_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_64_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Could not GET 'http://download.flutter.io/io/flutter/x86_64_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_64_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
               > Connection reset
      > Could not resolve io.flutter:x86_64_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/x86_64_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_64_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Could not GET 'http://download.flutter.io/io/flutter/x86_64_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_64_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
               > Connection reset

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

and my flutter doctor show as below

➜  flutter_demo flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.12.13+hotfix.6, on Mac OS X 10.15.2 19C57, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.41.1)
[✓] Connected device (1 available)

sky
  • 341
  • 1
  • 5
  • 8

17 Answers17

35

Run Flutter Doctor, if the section who says "android licenses" have a exclamation point and warning color, run flutter doctor --android-licenses. Just accept all and will be happy. It work to me.

Arghya Sadhu
  • 41,002
  • 9
  • 78
  • 107
DanizioGNR
  • 459
  • 4
  • 3
9

This sometimes happen when you have something in your dependencies that require internet eg. Firebase. Just turn on your wifi that should work!

8

I encountered same issue when i tried running my app on an actual device(App works perfectly on Emulator though) and i resolved it using:

' flutter pub cache repair ' This should fix the problem

  • 3
    this just redownloads packages...it doesn't fix the issue – Ayodeji Feb 23 '20 at 23:41
  • This error sometimes occurs when there are missing items in the package...So re-downloading the packages sometimes works...cause mine did – Charles Arko-Clayman Feb 25 '20 at 09:09
  • It's possible for packages in your pub cache to change or break. For example, some editors make it easy to find implementation files for packages in the pub cache, and you might accidentally edit one of those files. The pub cache repair command performs a clean reinstallation of all hosted and git packages in the system cache. – Charles Arko-Clayman Feb 25 '20 at 09:16
8

adding buildToolsVersion in app gradle removed the error for me.

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.0"
...
...
}
jeet.chanchawat
  • 5,842
  • 5
  • 38
  • 59
5

guys, thanks for all your answers.

I have figured it out , becaues I had used a proxy to connect network, so I set it in flutter , but when I close my proxy server, error happend. so if anyone have the same problem please check if you have set proxy in your flutter config file,vscode and Android Studio.

sky
  • 341
  • 1
  • 5
  • 8
3

i've faced this issue, i did run flutter clean in the terminal in the project root directory,after executing, it took some time to build gradle and to get dependencies after that ive re-builded my project and it worked prefectly fine, hope it fine for you too!

Arvind suresh
  • 221
  • 1
  • 3
  • 12
2

I faced the same issue, but later realised the Airplane mode was turned on. Once I turned it off, the issue was resolved. I don't know if it's about connecting to the internet or just turning off your airplane mode, will update.

Harshad
  • 51
  • 4
1

I solved problem by writting these in powerShell (windows) :

setx PUB_HOSTED_URL "https://pub.flutter-io.cn"
setx FLUTTER_STORAGE_BASE_URL "https://storage.flutter-io.cn"

It adds new environment variables.

ref:link

Zahra
  • 2,231
  • 3
  • 21
  • 41
1

I hade this problem Could not determine the dependencies of task ':app:processDebugResources'. and solved by running flutter pub cache repair

Zia
  • 506
  • 3
  • 20
1

With the Android Studio terminal go to android directory, run the gradle wrapper build command and see the log files content for detailed low level information:

cd android
gradlew build > logs.txt 2> errors.txt
Mohsen Emami
  • 2,709
  • 3
  • 33
  • 40
1

For me, I had forgotten to change to the latest version number in /android/app/build.gradle

dependencies {
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
     implementation 'com.google.android.material:material:<version>'
}

Should have been:

dependencies {
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
     implementation 'com.google.android.material:material:1.3.0'
}
Zog
  • 1,094
  • 2
  • 11
  • 24
1

Here we need to accept the android license so , when it tried to install Android SDK tools it throws error. so to accept the run the cmd in cmd tool - flutter doctor --android-licenses and accept all it works.

Basavaraj SK
  • 245
  • 3
  • 3
1

In my case, I run java.exe with argument --illegal-access=permit for burp suite run, but after that run I got into this issue. I've tried all above tips but I found a solution by re-installing java of a lower version and removing old version solve my issue.

Riccardo
  • 1,083
  • 2
  • 15
  • 25
1

My problem was solved when I run flutter doctor --android-licenses in the terminal and accept all SDK package licenses.

This problem occurred when I changed compileSdkVersion from 30 to 31, minSdkVersion from 16 to 19, targetSdkVersion from 30 to 31 in build.gradle.

0

adding buildToolsVersion in app gradle removed the error for me.

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.0"
}
G H Prakash
  • 1,720
  • 10
  • 30
0

I was getting the same error:

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Multiple task action failures occurred:
   > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
      > The minCompileSdk (31) specified in a
        dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
        is greater than this module's compileSdkVersion (android-30).
        Dependency: androidx.window:window-java:1.0.0-beta04.
        AAR metadata file: /Users/mac/.gradle/caches/transforms-2/files-2.1/303b1d5c92626d13b7b34f99ebc8e3cc/jetified-window-java-1.0.0-beta04/META-INF/com/android/build/gradle/aar-metadata.properties.
 > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
      > The minCompileSdk (31) specified in a
        dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
        is greater than this module's compileSdkVersion (android-30).
        Dependency: androidx.window:window:1.0.0-beta04.
        AAR metadata file: /Users/mac/.gradle/caches/transforms-2/files-2.1/89c5e3b5bbdbf14dfb30b0ad70ac7d82/jetified-window-1.0.0-beta04/META-INF/com/android/build/gradle/aar-metadata.properties.


First, don't panic, you face this problem when use flutter 2 or newer to build for android platform. This error cause by some dependency set compileSdkVersion in that dependency is 31. But your SDK Manager don't have.

  • So you have to open SDK Manager and check to download SDK 31 (in my case). Maybe you need SDK 32 or 33 I guess

enter image description here

  • You don't need to increase your compileSdkVersion.
  • Rebuild it
Dharman
  • 30,962
  • 25
  • 85
  • 135
0

I encountered the same problem, after trying various method, I was able to resolve it with two terminal commands

  1. run flutter clean
  2. flutter pub get

and that was it. it worked.

Ebenny
  • 1
  • 1