What went wrong: Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac‘.

转载文章链接为:https://blog.csdn.net/qq_43531694/article/details/106903618?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-7.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-7.channel_param

------------------------------------------------------------------------------------------------------

初学Flutter,在新建完成一个flutter项目时,开始构建Flutter,报错了,报错信息如下示例:

* 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-ee76268252c22f5c11e82a7b87423ca3982e51a7.

     Required by:

         project :app

截图如下:

What went wrong: Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac‘.

解决方案一:

找到该新建项目下的.gradle文件夹,删除掉,并且在当前目录下执行clean命令,发现不好使

What went wrong: Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac‘.

 

解决方案二:

原因是 :因为没有*,我们访问不到Google,导致编译不成功,所以我们需要*

修改flutter安装目录下的\packages\flutter_tools\gradle\flutter.gradle文件What went wrong: Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac‘.

 

将 private static final String MAVEN_REPO = "https://storage.googleapis.com/download.flutter.io";

修改为:

private static final String MAVEN_REPO = "https://storage.flutter-io.cn/download.flutter.io";

What went wrong: Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac‘.

What went wrong: Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac‘.

修改完成后,可以正常构建,如图所示:

What went wrong: Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac‘.