[英]Running flutter app in vscode and get this error Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'
i'm currently facing the problem in running my flutter app in physical device(phone).我目前在物理设备(电话)中运行我的 flutter 应用程序时遇到问题。 i'm using android studio 4 and vscode.我正在使用 android studio 4 和 vscode。 The error message is below.错误消息如下。
Launching lib\main.dart on TECNO B1f in debug mode...
lib\main.dart:1
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to find target with hash string 'android-29' in: C:\Users\Kitsson\AppData\Local\Android\sdk
* 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 7m 8s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
I would suggest 4 methods to solve this issue, try one after another until it works for you:我会建议 4 种方法来解决这个问题,一个接一个地尝试,直到它适合你:
Open terminal - run flutter doctor --android-licenses
.打开终端 - 运行flutter doctor --android-licenses
。 Just accept all and it should work, if it dosen't then skip to next step.只需接受所有内容,它应该可以工作,如果没有,则跳到下一步。
adding buildToolsVersion
in android => app => build.gradle
在android => app => build.gradle
中添加buildToolsVersion
android { compileSdkVersion 29 buildToolsVersion "29.0.0"... ... }
This often happens when you have something in your dependency that require internet like firebase.当您的依赖项中有一些需要 Internet 的东西时,通常会发生这种情况,例如 firebase。 Just turn on your internet or wifi .只需打开您的互联网或无线网络。
If none of them works then turn off developer option and turn it on again by pressing build number 7 times, this will revoke all usb debugging autherisation and ask whether to trust your developing machine, press yes and you will be good to go如果它们都不起作用,则关闭开发人员选项并通过按内部版本号再次打开它 7 次,这将撤销所有 usb 调试授权并询问是否信任您的开发机器,按是,您会很好 go
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.