秋梦无痕

一场秋雨无梦痕,春夜清风冻煞人。冬来冷水寒似铁,夏至京北蟑满城。

Avatar

AndroidStudio导入项目Gradle编译错误找不到project

AndroidStudio导入其他的项目(如libgdx),有可能出现以下错误:
Error:FAILURE: Build failed with an exception.

* What went wrong:
Task '' not found in root project 'XXXX'.

* Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

这时打开project根目录的iml文件,修改module为
external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4"
重新编译即可