flutter error Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'
Solution 1
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.
Solution 2
This sometimes happen when you have something in your dependencies that require internet eg. Firebase. Just turn on your wifi that should work!
Solution 3
adding buildToolsVersion
in app gradle removed the error for me.
android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
...
...
}
Solution 4
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
Solution 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
Updated on July 18, 2022Comments
-
sky almost 2 years
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)