小编Guy*_*ali的帖子

“根项目中的任务‘编译’不明确” - Android Studio

每次我尝试运行我的项目、清理它或构建它时,我都会收到一个 gradle 错误:

Error:FAILURE: Build failed with an exception.

* What went wrong:
Task 'compile' is ambiguous in root project 'FifiFun2'. Candidates are: 'compileDebugAidl', 'compileDebugAndroidTestAidl', 'compileDebugAndroidTestJavaWithJavac', 'compileDebugAndroidTestNdk', 'compileDebugAndroidTestRenderscript', 'compileDebugAndroidTestSources', 'compileDebugJavaWithJavac', 'compileDebugNdk', 'compileDebugRenderscript', 'compileDebugSources', 'compileDebugUnitTestJavaWithJavac', 'compileDebugUnitTestSources', 'compileLint', 'compileReleaseAidl', 'compileReleaseJavaWithJavac', 'compileReleaseNdk', 'compileReleaseRenderscript', 'compileReleaseSources', 'compileReleaseUnitTestJavaWithJavac', 'compileReleaseUnitTestSources'.

* 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.
Run Code Online (Sandbox Code Playgroud)

我尝试使用上面的选项(stacktrace、info、debug)运行 gradle 任务,但没有出现任何有用的结果。

等级:

// …
Run Code Online (Sandbox Code Playgroud)

android gradle android-studio android-gradle-plugin

6
推荐指数
1
解决办法
2万
查看次数