在项目首次导入编译时,总是会出现一些比较难排除的问题,特别是在提示中无法直接找到原因:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':bc_iothub:compileDebugJavaWithJavac'.
at org.gradle.api.internal.tasks.properties.DefaultTaskProperties.resolve(DefaultTaskProperties.java:76)
at org.gradle.execution.plan.LocalTaskNode.resolveMutations(LocalTaskNode.java:231)
at org.gradle.execution.plan.DefaultExecutionPlan.getResolvedMutationInfo(DefaultExecutionPlan.java:737)
at org.gradle.execution.plan.DefaultExecutionPlan.selectNext(DefaultExecutionPlan.java:649)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$executeNextNode$2(DefaultPlanExecutor.java:197)
at org.gradle.internal.resources.DefaultResourceLockCoordinationService.withStateLock(DefaultResourceLockCoordinationService.java:45)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:186)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:140)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
Caused by: org.gradle.api.internal.provider.AbstractProperty$PropertyQueryException: Failed to calculate the value of task ':bc_iothub:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
at org.gradle.api.internal.provider.AbstractProperty.finalizeNow(AbstractProperty.java:239)
at org.gradle.api.internal.provider.AbstractProperty.beforeRead(AbstractProperty.java:230)
at org.gradle.api.internal.provider.AbstractProperty.calculateOwnValueNoProducer(AbstractProperty.java:120)
at org.gradle.api.internal.file.DefaultFilePropertyFactory$AbstractFileVar.access$100(DefaultFilePropertyFactory.java:180)
at org.gradle.api.internal.file.DefaultFilePropertyFactory$AbstractFileVar$2.calculateOwnValue(DefaultFilePropertyFactory.java:263)
at org.gradle.api.internal.provider.AbstractMinimalProvider.getOrNull(AbstractMinimalProvider.java:93)
at org.gradle.api.internal.tasks.properties.FileParameterUtils.resolveOutputFilePropertySpecs(FileParameterUtils.java:122)
at org.gradle.api.internal.tasks.properties.OutputUnpacker.visitOutputFileProperty(OutputUnpacker.java:67)
at org.gradle.api.internal.tasks.properties.CompositePropertyVisitor.visitOutputFileProperty(CompositePropertyVisitor.java:69)
at org.gradle.api.internal.tasks.properties.annotations.AbstractOutputPropertyAnnotationHandler.visitPropertyValue(AbstractOutputPropertyAnnotationHandler.java:50)
at org.gradle.api.internal.tasks.properties.bean.AbstractNestedRuntimeBeanNode.visitProperties(AbstractNestedRuntimeBeanNode.java:56)
at org.gradle.api.internal.tasks.properties.bean.NestedRuntimeBeanNode.visitNode(NestedRuntimeBeanNode.java:41)
at org.gradle.api.internal.tasks.properties.DefaultPropertyWalker.visitProperties(DefaultPropertyWalker.java:41)
at org.gradle.api.internal.tasks.TaskPropertyUtils.visitProperties(TaskPropertyUtils.java:42)
at org.gradle.api.internal.tasks.properties.DefaultTaskProperties.resolve(DefaultTaskProperties.java:67)
at org.gradle.execution.plan.LocalTaskNode.resolveMutations(LocalTaskNode.java:231)
at org.gradle.execution.plan.DefaultExecutionPlan.getResolvedMutationInfo(DefaultExecutionPlan.java:737)
at org.gradle.execution.plan.DefaultExecutionPlan.selectNext(DefaultExecutionPlan.java:649)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$executeNextNode$2(DefaultPlanExecutor.java:197)
at org.gradle.internal.resources.DefaultResourceLockCoordinationService.withStateLock(DefaultResourceLockCoordinationService.java:45)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:186)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:140)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
Caused by: org.gradle.api.InvalidUserCodeException: Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, C:\Users\liuzs\StudioProjects\h-is24\bc_iothub\build\generated\ap_generated_sources\debug\out)) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer@cbd9bbb) before task ':bc_iothub:compileDebugJavaWithJavac' has completed is not supported
at org.gradle.api.internal.provider.TransformBackedProvider.lambda$beforeRead$0(TransformBackedProvider.java:84)
at org.gradle.api.internal.provider.ValueSupplier$TaskProducer.visitContentProducerTasks(ValueSupplier.java:136)
at org.gradle.api.internal.provider.TransformBackedProvider.beforeRead(TransformBackedProvider.java:81)
at org.gradle.api.internal.provider.TransformBackedProvider.calculateOwnValue(TransformBackedProvider.java:63)
at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
at org.gradle.api.internal.provider.MappingProvider.calculateOwnValue(MappingProvider.java:55)
at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
at org.gradle.api.internal.provider.AbstractMinimalProvider.withFinalValue(AbstractMinimalProvider.java:159)
at org.gradle.api.internal.provider.DefaultProperty.finalValue(DefaultProperty.java:133)
at org.gradle.api.internal.provider.DefaultProperty.finalValue(DefaultProperty.java:26)
at org.gradle.api.internal.provider.AbstractProperty.finalizeNow(AbstractProperty.java:236)
... 23 more
这里我使用的是Android Studio 2021.3.1
故在Terminal输入
./gradlew compileDebugJavaWithJavac
这里的提示是项目的gradle缺少gradle-wrapper.properties文件,我的解决方案是:文章来源:https://www.toymoban.com/news/detail-510567.html
从其他项目中拷贝一份gradle-wrapper.properties文章来源地址https://www.toymoban.com/news/detail-510567.html
到了这里,关于关于Android Studio编译时提示Execution failed for task ‘:xxx:compileDebugJavaWithJavac‘的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!