it-swarm.com.de

Aapt konnte nicht mit Cordova ausgeführt werden

Ich arbeite an einem Cordova-Projekt, das seit einiger Zeit einwandfrei funktioniert, und plötzlich bekam ich einen sehr merkwürdigen Fehler, wenn der Build erreicht wird ": app: processArm64DebugResources", wenn mit dem Befehl "cordova run Android --device" gebaut wird.

Ich habe versucht, Plattformen zu entfernen und hinzuzufügen, den Befehl clean auszuführen, Plugins zu aktualisieren und vieles mehr. Dieser Fehler betrifft jedoch nur eines meiner Cordova-Projekte. Wenn ich versuche, andere Projekte zu erstellen, erscheint kein Fehler.

Hier ist die Ausgabe:

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
19
Melkor

Fügen Sie dieses Plugin dem Projekt hinzu und es wird alles reparieren

cordova plugin add cordova-Android-support-gradle-release --fetch

Dies hat etwas mit einem Update zu tun, das Google auf Android 28 rc vorgenommen hat und zwei neue Felder hinzufügt. Danke den Göttern, dass jemand der Welt ein Plugin zur Verfügung gestellt hat, um es zu reparieren.

44
Bandito11

Für diejenigen, die nach dem 17/06/2019 mit diesem Problem konfrontiert sind. Nachdem ich einige Stunden mit diesem Thema verbracht hatte, fand ich endlich die Lösung. Dieser Buildfehler ist auf eine Hauptversionsversion der Google Play Services und Firebase am 17/06/2019 zurückzuführen

ionic cordova platform rm Android
ionic cordova platform add [email protected] 
ionic cordova plugin add cordova-plugin-androidx 
ionic cordova plugin add cordova-plugin-androidx-adapter

Hinweis: Dadurch wird Ihr Problem behoben

Hinweis: Wenn Sie Cordova-Plug-In-Firebase verwenden und Fehler auftreten, können Sie dieses Plug-In verwenden, das als Cordova-Plug-In-Firebasex veröffentlicht und zur Behebung von Problemen, die durch das neue Firebase-SDK verursacht werden, behoben wurde:

rm -Rf platforms/Android
cordova plugin rm cordova-plugin-firebase
rm -Rf plugins/ node_modules/
npm install
cordova plugin add cordova-plugin-firebasex
cordova platform add Android

Ich hoffe das wird helfen.

prost!

Ich habe die Lösung here ausprobiert, und jetzt habe ich erfolgreich mit Android gebaut.

file platforms/Android/app/build.gradle öffnen

hinzufügen 

configurations.all {
    resolutionStrategy {
        force 'com.Android.support:support-v4:27.1.0'
    }
}

nach dem 

dependencies {
    ...
}
14
Nho Huynh

Ich hatte den gleichen Fehler. In meinem Fall musste ich in meiner config.xml folgende Zeile entfernen:

<preference name="Orientation" value="all" />
0
tmuecksch