迁移到Gradle插件3.0时,默认情况下会启用AAPT2。当我试图构建项目时,我会遇到这个错误。我知道我可以在gradle.properties中禁用aapt2,但这是一个临时解决方案。有人遇到过这个问题吗?
:androidableview:processDebugAndroidTestResources错误:无法创建目录"C:\sm_build\Sales Management Android\androidableview\generated\source\r\androidTest\debug\br\com\dina\ui\test"。
执行aapt失败com.android.ide.common.prrocess.ProcessException:执行失败aaptcom.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:796)在com.android.build.gradle.tasks.ProcessAndroidResources.invokeAaptForSplit(ProcessAndroidResources.java:551)在com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:285)在com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:109)位于sun.reflect.GeneratedMethodAccessor244.reinvoke(未知源)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)位于java.lang.reflect.Method.ioke(Method.java:498)org.gradle.internal.reflect.JavaMethod.reinvoke(JavaMethod.java:73)org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:173)在org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)在org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfo Store.java:121)在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsSaskExecuter.java:122)在org.grade.internal.progress.DefaultBuildOperationExecutior$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)在org.grade.internal.progress.DefaultBuildOperationExecutior$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)在org.grade.internal.progress.DefaultBuildOperationExecution.execute(DefaultBuildOperationExecutor.java:197)在org.grade.internal.progress.DefaultBuildOperationExecutior.run(DefaultBuildOperationExecutor.java:107)在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)在org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUptoDateTaskExecutor.java:63)在org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutput CachingstateExecuter.java:54)在org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)在org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmpitySourceFilesTaskexecuter.java:88)在org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)在org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecution.execute(SkipTaskWithNoActionsExecuter.java:52)在org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnyIfTaskexecuter.java:54)在org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)在org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExcessionTaskExecuter.java:34)在org.gradle.expension.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)在org.grade.internal.progress.DefaultBuildOperationExecutior$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)在org.grade.internal.progress.DefaultBuildOperationExecutior$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)在org.grade.internal.progress.DefaultBuildOperationExecution.execute(DefaultBuildOperationExecutor.java:197)在org.grade.internal.progress.DefaultBuildOperationExecutior.run(DefaultBuildOperationExecutor.java:107)在org.gradle.expension.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)在org.gradle.expension.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)在org.gradle.execution.taskgraph.DefaultTaskPlanExecutior$TaskExecutiorWorker$1.execute(DefaultTaskPlanExecutiator.java:105)在org.gradle.execution.taskgraph.DefaultTaskPlanExecutior$TaskExecutiorWorker$1.execute(DefaultTaskPlanExecutiator.java:99)在org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)在org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)在org.gradle.expension.taskgraph.DefaultTaskPlanExecutiator$TaskExecutiorWorker.run(DefaultTaskPlanExecutior.java:99)在org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)在org.gradle.internal.concurrent.ManagedExecutiorImpl$1.run(ManagedExecutiorimpl.java:46)在java.util.concurrent.ThreadPoolExecutiator.runWorker(ThreadPoolExecutiator.java:1142)在java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)在org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)在java.lang.Thread.run(Thread.java:745)由以下原因引起:java.util.courrent.ExecutionException:java.util.courrent.ExecutionException:com.android.tools.aapt2.aapt2异常:aapt2错误:检查日志详细信息,请访问com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)在com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:482)在com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:79)在com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:794)…47更多原因:java.util.courrent.ExecutionException:com.android.tools.aapt2.aapt2异常:aapt2错误:检查日志详细信息,请访问com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)在com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:462)在com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:79)在com.android.builder.internal.aapt.v2.QueueableAapt2.lambda$makeValidatedPackage$1(QueueableAapt2.java:179)在java.util.concurrent.ThreadPoolExecutiator.runWorker(ThreadPoolExecutiator.java:1142)在java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)…1更多原因:com.android.tools.aapt2.aapt2异常:aapt2错误:有关详细信息,请查看日志com.android.builder.png.AaptProcess$NotificationProcessOutput.handleOutput(AaptProcess.java:454)在com.android.builder.png.AaptProcess$NotificationProcessOutput.err(AaptProcess.java:411)在com.android.builder.png.AaptProcess$ProcessOutputFacade.err(AaptProcess.java:332)在com.android.utils.GrabProcessOutput$1.run(GrabProcessOutput.java:104)
尝试使用--info参数运行gradle构建。你可能会发现问题出在哪里,在我的情况下,它使用的是aaptOptions { additionalParameters '--utf16' }
这是一个AS错误。当你从build.gradle更改构建目录时,就会发生这种情况。我打开了一个问题,请星号https://issuetracker.google.com/issues/68936311