问题

android studio 报错:
Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac’. >
Could not resolve all task dependencies for configuration ‘:app:debugCompileClasspath’.

       

原因

        在网上搜了一圈,大多说的都是要改buid.gradle的内容。
        我寻思着这项目在公司都跑得通,怎么在家居家办公,拉下来的代码就跑不通了?应该不是buid.gradle的问题。看报错信息应该是什么dependencies找不到,这个工程里依赖了一些git submodule,可能是这些git子仓库没拉下来。

       

解决办法:

        在IDE的terminal 运行 git submodule update --init --recursive ,更新项目中的所有子仓库,重新build,就能运行了。

       
       

        如果你的项目没有依赖git子仓库,那肯定不是这个原因,也不是上面这个解决方法。其他原因可参考:Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac’

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐