* What went wrong: Execution failed for task ':app:processDebugResources'. > Failed to execute aapt

ionic cordova build android   报错,关键信息:

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt

完整错误:

ute(SkipUpToDateTaskExecuter.java:63)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingState
Executer.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execut
e(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecu
ter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskE
xecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter
.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execut
e(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter
.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.ex
ecute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTa
skWorker$1.run(DefaultTaskGraphExecuter.java:248)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBu
ildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBu
ildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(De
faultBuildOperationExecutor.java:197)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul
tBuildOperationExecutor.java:107)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTa
skWorker.execute(DefaultTaskGraphExecuter.java:241)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTa
skWorker.execute(DefaultTaskGraphExecuter.java:230)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWo
rker.processTask(DefaultTaskPlanExecutor.java:124)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWo
rker.access$200(DefaultTaskPlanExecutor.java:80)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWo
rker$1.execute(DefaultTaskPlanExecutor.java:105)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWo
rker$1.execute(DefaultTaskPlanExecutor.java:99)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(Defau
ltTaskExecutionPlan.java:625)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTa
sk(DefaultTaskExecutionPlan.java:580)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWo
rker.run(DefaultTaskPlanExecutor.java:99)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.
onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecu
torImpl.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnabl
e.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.ExecutionException: java.util.concurrent.Executi
onException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for
 details
        at com.google.common.util.concurrent.AbstractFuture.getDoneValue(Abstrac
tFuture.java:503)
        at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.j
ava:482)
        at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(Ab
stractFuture.java:79)
        at com.android.builder.core.AndroidBuilder.processResources(AndroidBuild
er.java:794)
        ... 47 more
Caused by: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt
2Exception: AAPT2 error: check logs for details
        at com.google.common.util.concurrent.AbstractFuture.getDoneValue(Abstrac
tFuture.java:503)
        at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.j
ava:462)
        at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(Ab
stractFuture.java:79)
        at com.android.builder.internal.aapt.v2.QueueableAapt2.lambda$makeValida
tedPackage$1(QueueableAapt2.java:179)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:624)
        ... 1 more
Caused by: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for d
etails
        at com.android.builder.png.AaptProcess$NotifierProcessOutput.handleOutpu
t(AaptProcess.java:454)
        at com.android.builder.png.AaptProcess$NotifierProcessOutput.err(AaptPro
cess.java:411)
        at com.android.builder.png.AaptProcess$ProcessOutputFacade.err(AaptProce
ss.java:332)
        at com.android.utils.GrabProcessOutput$1.run(GrabProcessOutput.java:104)


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.

* Get more help at https://help.gradle.org
 

解决办法:

Replace com.android.support:support-v4:+ with com.android.support:support-v4:27.1.0 in project.properties file under platform/android folder

把在   项目路径\platforms\android  下的project.properties文件中的

cordova.system.library.1=com.android.support:support-v4:28.+
cordova.system.library.2=com.android.support:appcompat-v7:28.+

改成:

cordova.system.library.1=com.android.support:support-v4:27.+
cordova.system.library.2=com.android.support:appcompat-v7:27.+

参考回答链接:

https://stackoverflow.com/questions/48725618/ionic-3-execution-failed-for-task-appprocessdebugresources

 

 

 

 

 

你可能感兴趣的:(ionic,error)