Je travaille sur un projet Cordova qui fonctionne bien depuis un certain temps et, tout à coup, une erreur très étrange s'est produite lorsque la construction atteint ": app: processArm64DebugResources" lors de la création de la commande "cordova run Android --device".
J'ai essayé de supprimer et d'ajouter des plates-formes, d'exécuter la commande clean, de mettre à jour des plugins, etc. Cette erreur n'affecte que l'un de mes projets Cordova. Lorsque j'essaie de créer d'autres projets, il n'y a pas d'erreur.
Voici la sortie:
C:\Users\user\.gradle\caches\transforms-1\files-1.1\xwalk_core_library-23.53.589.4.aar\e854897d765996e71d496a6d28135238\res\values\dimens_03.xml:14:5-51: AAPT: error: resource Android:attr/fontVariationSettings not found.
C:\Users\user\.gradle\caches\transforms-1\files-1.1\xwalk_core_library-23.53.589.4.aar\e854897d765996e71d496a6d28135238\res\values\dimens_03.xml:14:5-51: AAPT: error: resource Android:attr/ttcIndex not found.
C:\Users\user\Documents\Coding\Project Grid\grid\platforms\Android\app\build\intermediates\incremental\mergeArm64DebugResources\merged.dir\values\values.xml:100: error: resource Android:attr/fontVariationSettings not found.
C:\Users\user\Documents\Coding\Project Grid\grid\platforms\Android\app\build\intermediates\incremental\mergeArm64DebugResources\merged.dir\values\values.xml:100: error: resource Android:attr/ttcIndex not found.
error: failed linking references.
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.NativeMethodAccessorImpl.invoke0(Native Method)
at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:62)
at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
at Java.lang.reflect.Method.invoke(Method.Java:497)
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)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.Java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.Java:88)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.Java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.Java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.Java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.Java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.Java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.Java:248)
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.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.Java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.Java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.Java:124)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.Java:80)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.Java:105)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.Java:99)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.Java:625)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.Java:580)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.Java:99)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.Java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.Java:46)
at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1142)
at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.Java:55)
at Java.lang.Thread.run(Thread.Java:745)
Caused by: Java.util.concurrent.ExecutionException: Java.util.concurrent.ExecutionException: com.Android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.Java:503)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.Java:482)
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.Java:79)
at com.Android.builder.core.AndroidBuilder.processResources(AndroidBuilder.Java:794)
... 48 more
Caused by: Java.util.concurrent.ExecutionException: com.Android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.Java:503)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.Java:462)
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.Java:79)
at com.Android.builder.internal.aapt.v2.QueueableAapt2.lambda$makeValidatedPackage$1(QueueableAapt2.Java:179)
at com.Android.builder.internal.aapt.v2.QueueableAapt2$$Lambda$308/383079173.run(Unknown Source)
at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1142)
at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:617)
... 1 more
Caused by: com.Android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
at com.Android.builder.png.AaptProcess$NotifierProcessOutput.handleOutput(AaptProcess.Java:454)
at com.Android.builder.png.AaptProcess$NotifierProcessOutput.err(AaptProcess.Java:411)
at com.Android.builder.png.AaptProcess$ProcessOutputFacade.err(AaptProcess.Java:332)
at com.Android.utils.GrabProcessOutput$1.run(GrabProcessOutput.Java:104)
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processArm64DebugResources'.
> 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
BUILD FAILED in 1m 23s
32 actionable tasks: 32 executed
(node:6948) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
C:\Users\user\.gradle\caches\transforms-1\files-1.1\xwalk_core_library-23.53.589.4.aar\e854897d765996e71d496a6d28135238\res\values\dimens_03.xml:14:5-51: AAPT: error: resource Android:attr/fontVariationSettings not found.
C:\Users\user\.gradle\caches\transforms-1\files-1.1\xwalk_core_library-23.53.589.4.aar\e854897d765996e71d496a6d28135238\res\values\dimens_03.xml:14:5-51: AAPT: error: resource Android:attr/ttcIndex not found.
C:\Users\user\Documents\Coding\Project Grid\grid\platforms\Android\app\build\intermediates\incremental\mergeArm64DebugResources\merged.dir\values\values.xml:100: error: resource Android:attr/fontVariationSettings not found.
C:\Users\user\Documents\Coding\Project Grid\grid\platforms\Android\app\build\intermediates\incremental\mergeArm64DebugResources\merged.dir\values\values.xml:100: error: resource Android:attr/ttcIndex not found.
error: failed linking references.
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.NativeMethodAccessorImpl.invoke0(Native Method)
at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:62)
at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
at Java.lang.reflect.Method.invoke(Method.Java:497)
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)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.Java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.Java:88)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.Java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.Java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.Java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.Java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.Java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.Java:248)
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.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.Java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.Java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.Java:124)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.Java:80)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.Java:105)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.Java:99)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.Java:625)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.Java:580)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.Java:99)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.Java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.Java:46)
at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1142)
at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.Java:55)
at Java.lang.Thread.run(Thread.Java:745)
Caused by: Java.util.concurrent.ExecutionException: Java.util.concurrent.ExecutionException: com.Android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.Java:503)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.Java:482)
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.Java:79)
at com.Android.builder.core.AndroidBuilder.processResources(AndroidBuilder.Java:794)
... 48 more
Caused by: Java.util.concurrent.ExecutionException: com.Android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.Java:503)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.Java:462)
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.Java:79)
at com.Android.builder.internal.aapt.v2.QueueableAapt2.lambda$makeValidatedPackage$1(QueueableAapt2.Java:179)
at com.Android.builder.internal.aapt.v2.QueueableAapt2$$Lambda$308/383079173.run(Unknown Source)
at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1142)
at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:617)
... 1 more
Caused by: com.Android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
at com.Android.builder.png.AaptProcess$NotifierProcessOutput.handleOutput(AaptProcess.Java:454)
at com.Android.builder.png.AaptProcess$NotifierProcessOutput.err(AaptProcess.Java:411)
at com.Android.builder.png.AaptProcess$ProcessOutputFacade.err(AaptProcess.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:processArm64DebugResources'.
> 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
BUILD FAILED in 1m 23s
Ajoutez ce plugin au projet et cela corrigera tout
cordova plugin add cordova-Android-support-gradle-release --fetch
Cela a quelque chose à voir avec une mise à jour de Google vers Android 28 qui ajoute deux nouveaux champs. Merci aux dieux, quelqu'un a partagé un plugin avec le monde pour le réparer.
J'ai essayé la solution montrée ici et maintenant, j'ai construit avec succès avec Android.
Ouvrez file platforms/Android/app/build.gradle
ajouter
configurations.all {
resolutionStrategy {
force 'com.Android.support:support-v4:27.1.0'
}
}
après
dependencies {
...
}
J'ai eu la même erreur. Dans mon cas, j'ai dû supprimer dans mon fichier config.xml la ligne suivante:
<preference name="Orientation" value="all" />