赞
踩
Execution failed for task ‘:compileReleaseJavaWithJavac’.
:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:compileReleaseJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileReleaseJavaWithJavac'.
> Could not find tools.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
根据上述提示
Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output.
D:\AndroidStudioProject\lava_packages_apps_PowerSave>gradle compile DebugJavaWithJavac
Observed package id 'platforms;android-lava6737-503' in inconsistent location 'D:\AndroidStudioProjectsSDK\sdk\platforms\android-lava6737-503-203' (Expected 'D:\AndroidStudioProjectsSDK\sdk\platforms\android-lava6737-503')
Incremental java compilation is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
Task 'compile' is ambiguous in root project 'lava_packages_apps_PowerSave'. Candidates are: 'compileDebugAidl', 'compileDebugAndroidTestAidl', 'compileDebugAndroidTestJavaWithJavac', 'compileDebugAndroidTestNdk', 'compileDebugAndro
idTestRenderscript', 'compileDebugAndroidTestShaders', 'compileDebugAndroidTestSources', 'compileDebugJavaWithJavac', 'compileDebugNdk', 'compileDebugRenderscript', 'compileDebugShaders', 'compileDebugSources', 'compileDebugUnitTes
tJavaWithJavac', 'compileDebugUnitTestSources', 'compileLint', 'compileReleaseAidl', 'compileReleaseJavaWithJavac', 'compileReleaseNdk', 'compileReleaseRenderscript', 'compileReleaseShaders', 'compileReleaseSources', 'compileReleas
eUnitTestJavaWithJavac', '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.
BUILD FAILED
Total time: 9.403 secs
查看更详细描述
D:\AndroidStudioProject\lava_packages_apps_PowerSave>gradle compileDebug --stacktrace
Observed package id 'platforms;android-lava6737-503' in inconsistent location 'D:\AndroidStudioProjectsSDK\sdk\platforms\android-lava6737-503-203' (Expected 'D:\AndroidStudioProjectsSDK\sdk\platforms\android-lava6737-503')
Incremental java compilation is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
Task 'compileDebug' is ambiguous in root project 'lava_packages_apps_PowerSave'. Candidates are: 'compileDebugAidl', 'compileDebugAndroidTestAidl', 'compileDebugAndroidTestJavaWithJavac', 'compileDebugAndroidTestNdk', 'compileDebug
AndroidTestRenderscript', 'compileDebugAndroidTestShaders', 'compileDebugAndroidTestSources', 'compileDebugJavaWithJavac', 'compileDebugNdk', 'compileDebugRenderscript', 'compileDebugShaders', 'compileDebugSources', 'compileDebugUn
itTestJavaWithJavac', 'compileDebugUnitTestSources'.
* Try:
Run gradle tasks to get a list of available tasks. Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.execution.TaskSelectionException: Task 'compileDebug' is ambiguous in root project 'lava_packages_apps_PowerSave'. Candidates are: 'compileDebugAidl', 'compileDebugAndroidTestAidl', 'compileDebugAndroidTestJavaWithJavac'
, 'compileDebugAndroidTestNdk', 'compileDebugAndroidTestRenderscript', 'compileDebugAndroidTestShaders', 'compileDebugAndroidTestSources', 'compileDebugJavaWithJavac', 'compileDebugNdk', 'compileDebugRenderscript', 'compileDebugSha
ders', 'compileDebugSources', 'compileDebugUnitTestJavaWithJavac', 'compileDebugUnitTestSources'.
at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:100)
at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:75)
at org.gradle.execution.commandline.CommandLineTaskParser.parseTasks(CommandLineTaskParser.java:42)
at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.configure(TaskNameResolvingBuildConfigurationAction.java:44)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:48)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$000(DefaultBuildConfigurationActionExecuter.java:25)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter$1.proceed(DefaultBuildConfigurationActionExecuter.java:54)
at org.gradle.execution.DefaultTasksBuildExecutionAction.configure(DefaultTasksBuildExecutionAction.java:44)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:48)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$000(DefaultBuildConfigurationActionExecuter.java:25)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter$1.proceed(DefaultBuildConfigurationActionExecuter.java:54)
at org.gradle.execution.ExcludedTaskFilteringBuildConfigurationAction.configure(ExcludedTaskFilteringBuildConfigurationAction.java:47)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:48)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter.select(DefaultBuildConfigurationActionExecuter.java:36)
at org.gradle.initialization.DefaultGradleLauncher$3.run(DefaultGradleLauncher.java:143)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:140)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:48)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
BUILD FAILED
Total time: 10.226 secs
D:\AndroidStudioProject\lava_packages_apps_PowerSave>gradle compile DebugJavaWithJavac
Observed package id 'platforms;android-lava6737-503' in inconsistent location 'D:\AndroidStudioProjectsSDK\sdk\platforms\android-lava6737-503-203' (Expected 'D:\AndroidStudioProjectsSDK\sdk\platforms\android-lava6737-503')
Incremental java compilation is an incubating feature.
根据提示将 android-lava6737-503-203
D:\AndroidStudioProjectsSDK\sdk\platforms\android-lava6737-503-203
修改为
D:\AndroidStudioProjectsSDK\sdk\platforms\android-lava6737-503
* What went wrong:
Execution failed for task ':compileReleaseJavaWithJavac'.
> Could not find tools.jar
查看环境变量和查看Java的文件位置,发现最近Java自动更新了版本,导致编译不过
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;D:\Eclipse\sdk\platform-tools;D:\MySQL\bin;D:\GitSoftware\Git\bin;D:\Python36\Scripts;D:\Android_Studio\StudioSoftWare\gradle\gradle-2.10\bin;D:\Go\bin;C:\MinGW\bin;
新增java环境变量
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;D:\Eclipse\sdk\platform-tools;D:\MySQL\bin;D:\GitSoftware\Git\bin;D:\Python36\Scripts;D:\Android_Studio\StudioSoftWare\gradle\gradle-2.10\bin;D:\Go\bin;C:\MinGW\bin;C:\Program Files\Java\jre1.8.0_171\bin;C:\Program Files\Java\jdk1.8.0_131\bin;
找到当前用户目录下的 .gradle 目录,若不存在则创建 gradle.properties 文件,然后在文件中输入如下内容:
org.gradle.java.home=C:\\Program Files\\Java\\jdk1.8.0_131
然后重启gradle,执行 gradle aR
BUILD SUCCESSFUL
Total time: 28.138 secs
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。