本文介绍了无法执行Aapt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助解决该错误:

 无法执行aapt 
com.android.ide.common.process .ProcessException:无法在com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:796)上执行aapt
(com.android.build.gradle.tasks.ProcessAndroidResources.invokeAaptForSplit(ProcessAndroidResources) .java:551)com.android.build.gradle.tasks.ProcessAndroidResources.doFullTask​​Action(ProcessAndroidResources.java:285)
com.android.build.gradle.internal.tasks.IncrementalTask​​.taskAction (IncrementalTask​​.java:109)在sun.reflect.GeneratedMethodAccessor540.invoke处的
(未知源)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)处的
在java.lang处.reflect.Method.invoke(Method.java:498)
在org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
在org.gradle.api.internal.project .taskfactory.DefaultTaskClassInfoStore $ IncrementalTask​​Action.doExecute(DefaultTaskC lassInfoStore.java:173)
在org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore $ StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
在org.gradle.api.internal.project。 taskfactory.DefaultTaskClassInfoStore $ StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter $ 1.run(ExecuteActionsTaskExecuter.java:122)
在org.gradle .internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)$ b $ .internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
在org.gradle.api.internal .tasks.execution.ExecuteActions在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
在org.gradle.api.internal处的TaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
task.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
在org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
在org.gradle。 api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)


解决方案

添加此行

  android.enableAapt2 = false 

到gradle.properties文件



  android.useDeprecatedNdk = true 
andr oid.enableAapt2 = false
MYAPP_RELEASE_STORE_FILE = xxxxxxx
MYAPP_RELEASE_KEY_PASSWORD = xxxxxx
MYAPP_RELEASE_STORE_PASSWORD = xxxxxxxx
MYAPP_RELEASE_KEY_PASSWORD = xxxxxxxxx
>

Please help solving this error:

Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt
at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:796)
at com.android.build.gradle.tasks.ProcessAndroidResources.invokeAaptForSplit(ProcessAndroidResources.java:551)
at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:285)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:109)
at sun.reflect.GeneratedMethodAccessor540.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:173)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
解决方案

Add this line

android.enableAapt2=false

To your gradle.properties file

android.useDeprecatedNdk=true
android.enableAapt2=false
MYAPP_RELEASE_STORE_FILE=xxxxxxx
MYAPP_RELEASE_KEY_ALIAS=xxxxx
MYAPP_RELEASE_STORE_PASSWORD=xxxxxxxx
MYAPP_RELEASE_KEY_PASSWORD=xxxxxxxxx

这篇关于无法执行Aapt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-09 21:30