web-dev-qa-db-ja.com

IonicアプリはAndroid AAPTエラーでビルドできません

ブラウザでエミュレートするIonicアプリを作成していますが、Androidでビルドしようとするとすぐに失敗します。 AATPでエラーが発生したように見えますが、どうしてこれが起こるのか本当にわかりません。エラーログを次に示します。

Running app-scripts build: --platform Android --target cordova
[00:03:39]  build dev started ... 
[00:03:39]  clean started ... 
[00:03:39]  clean finished in 36 ms 
[00:03:39]  copy started ... 
[00:03:39]  deeplinks started ... 
[00:03:39]  deeplinks finished in 46 ms 
[00:03:39]  transpile started ... 
[00:03:43]  transpile finished in 4.22 s 
[00:03:43]  preprocess started ... 
[00:03:43]  preprocess finished in 1 ms 
[00:03:43]  webpack started ... 
[00:03:43]  copy finished in 4.49 s 
[00:03:50]  webpack finished in 6.46 s 
[00:03:50]  sass started ... 
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
[00:03:51]  sass finished in 942 ms 
[00:03:51]  postprocess started ... 
[00:03:51]  postprocess finished in 14 ms 
[00:03:51]  lint started ... 
[00:03:51]  build dev finished in 11.87 s 
> cordova run Android
Android Studio project detected
Android_HOME=E:\AndroidSDK
Java_HOME=C:\Program Files\Java\jdk1.8.0_161
studio
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
    at build_c6trj2zw0ratkgf1y8h09dz0v.run(C:\Users\Sebastian\Google Drive\GIT\myepa_mobile\platforms\Android\app\build.gradle:144)
[00:03:56]  tslint: C:/Users/Sebastian/Google Drive/GIT/myepa_mobile/src/pages/scanner/scanner.ts, line: 24 
            Property 'alertCtrl' is declared but never used. 

      L23:  private qrScanner: BarcodeScanner,
      L24:  private alertCtrl: AlertController,
      L25:  private storage: StorageProvider,

            Property 'storage' is declared but never used. 

      L24:  private alertCtrl: AlertController,
      L25:  private storage: StorageProvider,
      L26:  private api: ApiProvider,

            All imports are unused. 

       L2:  //import { NavController, NavParams } from 'ionic-angular';
       L3:  i[00:03:56]  tslint: C:/Users/Sebastian/Google Drive/GIT/myepa_mobile/src/pages/scanner/scanner.ts, line: 25 
[00:03:56]  tslint: ...bastian/Google Drive/GIT/myepa_mobile/src/pages/medicationplan/medicationplan.ts, line: 3 
[00:03:56]  tslint: C:/Users/Sebastian/Google Drive/GIT/myepa_mobile/src/pages/settings/settings.ts, line: 13 
[00:03:56]  tslint: C:/Users/Sebastian/Google Drive/GIT/myepa_mobile/src/pages/docs/docs.ts, line: 18 
[00:03:56]  tslint: C:/Users/Sebastian/Google Drive/GIT/myepa_mobile/src/pages/docs/docs.ts, line: 21 
mport {BarcodeScanner, BarcodeScannerOptions} from "@ionic-native/barcode-scanner";
       L4:  //import {StorageProvider} from "../../providers/storage/storage";

            Property 'navParams' is declared but never used. 

      L12:  constructor(private navCtrl: NavController,
      L13:              private navParams: NavParams,
      L14:              private storage: StorageProvider,

            Property 'navParams' is declared but never used. 

      L17:  constructor(private navCtrl: NavController,
      L18:              private navParams: NavParams,
      L19:              private api: ApiProvider,

            Property 'zone' is declared but never used. 

      L20:            private events: Events,
      L21:            private zone: NgZone) {
      L22:  events.subscribe("res:update", () =>{

[00:03:56]  lint finished in 5.12 s 
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:checkDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:prepareLintJar UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:platformAttrExtractor UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:javaPreCompileDebug UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes NO-SOURCE
:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:CordovaLib:packageDebugRenderscript NO-SOURCE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:app:processDebugResourcesC:\Users\Sebastian\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0-alpha1.aar\87f8372badb42114e191aeebff73693e\res\values\values.xml:20:5-70: AAPT: error: resource Android:attr/fontVariationSettings not found.

C:\Users\Sebastian\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0-alpha1.aar\87f8372badb42114e191aeebff73693e\res\values\values.xml:20:5-70: AAPT: error: resource Android:attr/ttcIndex not found.

C:\Users\Sebastian\Google Drive\GIT\myepa_mobile\platforms\Android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:141: error: resource Android:attr/fontVariationSettings not found.
C:\Users\Sebastian\Google Drive\GIT\myepa_mobile\platforms\Android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:141: 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: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)
    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) FAILED
25 actionable tasks: 1 executed, 24 up-to-date

    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:1149)
    at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:624)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.Java:55)
    at Java.lang.Thread.run(Thread.Java:748)
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 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 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: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

BUILD FAILED in 3s
(node:14708) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output:
C:\Users\Sebastian\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0-alpha1.aar\87f8372badb42114e191aeebff73693e\res\values\values.xml:20:5-70: AAPT: error: resource Android:attr/fontVariationSettings not found.

C:\Users\Sebastian\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0-alpha1.aar\87f8372badb42114e191aeebff73693e\res\values\values.xml:20:5-70: AAPT: error: resource Android:attr/ttcIndex not found.

C:\Users\Sebastian\Google Drive\GIT\myepa_mobile\platforms\Android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:141: error: resource Android:attr/fontVariationSettings not found.
C:\Users\Sebastian\Google Drive\GIT\myepa_mobile\platforms\Android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:141: 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: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)
    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:1149)
    at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:624)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.Java:55)
    at Java.lang.Thread.run(Thread.Java:748)
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 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 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: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

BUILD FAILED in 3s
(node:14708) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

[OK] Your app has been deployed.
     Did you know you can live-reload changes from your app with --livereload?

この日は早くアプリの構築がうまくいったので、私は本当に何が起こったのですか?.

私のIonicプロジェクト環境情報:

cli packages: (C:\Users\Sebastian\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : Android 7.0.0 browser 5.0.3
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v8.9.4
    npm               : 5.6.0
    OS                : Windows 10

Environment Variables:

    Android_HOME : E:\AndroidSDK

Misc:

    backend : pro

編集:私はすべてのプラグインを削除し、それらを一つずつインストールすることで問題を解決しました。プラグインBarcodeScannerが問題でした( ここ )。 platform/Android/phonegap-plugin-barcodescannerの下のstarter-barcodescanner.gradleファイルで値compile 'com.Android.support:support-v4:+'compile 'com.Android.support:support-v4:23+'に変更すると、問題が解決しました。

22
Klitz

一部のプラグインは、他の返信で説明されているAndroidサポートライブラリの新しい更新により非互換性が発生する場合があります。

最も簡単な修正は、「cordova-Android-support-gradle-release」プラグインをインストールすることです。このプラグインは、クラッシュしたプラグインのバージョンを自動的に調整し、プラグインを引き続き使用できます

また、この修正は永続的です。手動でバージョンをプラグインに直接変更する場合と比較します。

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

また、 documentation およびその他の関連する問題 here を確認することもできます。

15

これは@avmatteによって私のために答えられました ここ

2
Chris Ritten

コアCordovaでは、このプラグインによって修正されました。

https://github.com/dpa99c/cordova-Android-support-gradle-release

2
jorrit

このビルドの失敗は、6月17日のGoogle Play ServicesおよびFirebaseライブラリのメジャーバージョンリリースによるものです。

私のために働いた

実行:

  1. ionic cordova platform rm Android

  2. あなたがfirebaseを使用している場合

    cordova plugin remove cordova-plugin-firebase
    
    cordova plugin add cordova-plugin-firebase-lib
    
  3. 実行:

ionic cordova plugin add cordova-plugin-androidx

  1. 実行:

ionic cordova plugin add cordova-plugin-androidx-adapter

  1. 実行:

    ionic cordova platform add [email protected]

APKでお楽しみください

ionic cordova build Android --prod --release

2
Dhamu

私の答えはここにありました:

ビルドエラー-Ionic CordovaがAndroidで失敗する

また、私の場合、de.appplant.cordova.plugin.local-notificationプラグインのみに含まれていた上記と同様の修正が必要でした。 「com.Android.support:support-v4:+」を「com.Android.support:support-v4:23+」に変更し、Androidプラットフォームを削除して追加し、ビルドしました。ただし、build-extras.gradleには追加のブレース '}'があり、これも削除する必要がありました。

0
Mark A. Rupert

Gradle-pluginが修正したことを確認できます。以前にサポートバージョン番号を試してみましたが、3週間のデバッグの後、プラグインだけがそれを解決しました!

0
Rob