26

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) 
4
  • i have the same issue, let me know if find smth Commented Jan 1, 2020 at 1:35
  • any solution found ? Commented Feb 24, 2020 at 11:43
  • 1
    needed other answer for this, answer below are not working for me Commented May 7, 2020 at 6:59
  • 1
    stackoverflow.com/a/60484500/10121512 The solution here is to delete the files from the build directory Commented Aug 17, 2022 at 12:18

19 Answers 19

37

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Worked for me, flutter doctor is a savior
9

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 Comments

this just redownloads packages...it doesn't fix the issue
This error sometimes occurs when there are missing items in the package...So re-downloading the packages sometimes works...cause mine did
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.
9

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

1 Comment

yes, you are right, this solves my problem, thank you dude
9

adding buildToolsVersion in app gradle removed the error for me.

android { compileSdkVersion 29 buildToolsVersion "29.0.0" ... ... } 

Comments

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.

Comments

4

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!

Comments

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.

Comments

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

Comments

1

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

Comments

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 

Comments

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' } 

Comments

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.

Comments

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.

Comments

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.

Comments

0

adding buildToolsVersion in app gradle removed the error for me.

android { compileSdkVersion 30 buildToolsVersion "30.0.0" } 

Comments

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

Comments

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.

Comments

0

Hi if you scroll up to this point, i feel your pain. Cause none of the above options worked for me too :(, I figured it out my self after run flutter doctor and i see there are two versions of flutter one my main flutter installation and the second one is from shorebird, which was causing the issue with the dart. My fix is: i just disable shorebird and use my main flutter installation. Am using this version of shorebird as of now it's the latest version

Output for shorebird --version

shorebird 1.2.0 • [email protected]:shorebirdtech/shorebird.git Flutter 3.24.0 • revision a44a61357b957c5af14483cc090373057c1ce6ea Engine • revision a54c12376ca40409b2bbb83fedaf0910a055b2d0

Comments

0

For me i pasted this

subprojects { afterEvaluate { project -> if (project.hasProperty('android')) { android { compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } } tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { kotlinOptions { jvmTarget = "1.8" } } } } 

in my build.gradle under the android folder before

rootProject.buildDir = '../build' 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.