在cordova构建期间找不到dialogCornerRadius,fontVariationSettings和ttcIndex

时间:2018-11-21 08:45:45

标签: android cordova ionic3

我对此问题进行了很多尝试,解决方案是将android支持的版本强制为27。安装插件

cordova-android-support-gradle-release -variable ANDROID_SUPPORT_VERSION = 27.+

这些错误消失了,仅是另一个出现了另一个插件的Java类固有的问题,而找不到

  

未找到com.google.android.gms.internal.zzbfm类

在构建阶段生成的错误:

:app:splitsDiscoveryTaskDebug 

/home/trip/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0.aar/8982e9a5aeacb8b77f78fc202fe2ff0a/res/values-v28/values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found. /home/trip/workspace/wanda-Angular5/platforms/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found.
     /home/trip/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0.aar/8982e9a5aeacb8b77f78fc202fe2ff0a/res/values/values.xml:1304:5-69: AAPT: error: resource android:attr/fontVariationSettings not found.
     /home/trip/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0.aar/8982e9a5aeacb8b77f78fc202fe2ff0a/res/values/values.xml:1304:5-69: AAPT: error: resource android:attr/ttcIndex not found.
     /home/trip/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0.aar/8982e9a5aeacb8b77f78fc202fe2ff0a/res/values/values.xml:1304:5-69: AAPT: error: resource android:attr/dialogCornerRadius not found.
     /home/trip/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0.aar/8982e9a5aeacb8b77f78fc202fe2ff0a/res/values/values.xml:1304:5-69: AAPT: error: resource android:attr/fontVariationSettings not found.
     /home/trip/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0.aar/8982e9a5aeacb8b77f78fc202fe2ff0a/res/values/values.xml:1304:5-69: AAPT: error: resource android:attr/ttcIndex not found.
     /home/trip/workspace/wanda-Angular5/platforms/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found. /home/trip/workspace/wanda-Angular5/platforms/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found. /home/trip/workspace/wanda-Angular5/platforms/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:676: error: resource android:attr/fontVariationSettings not found. /home/trip/workspace/wanda-Angular5/platforms/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:676: error: resource android:attr/ttcIndex not found. /home/trip/workspace/wanda-Angular5/platforms/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:902: error: resource android:attr/dialogCornerRadius not found. /home/trip/workspace/wanda-Angular5/platforms/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:903: error: resource android:attr/fontVariationSettings not found. /home/trip/workspace/wanda-Angular5/platforms/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:909: 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.GeneratedMethodAccessor548.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)     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)    ... 47 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:463)     at com.android.builder.png.AaptProcess$NotifierProcessOutput.err(AaptProcess.java:415)  at com.android.builder.png.AaptProcess$ProcessOutputFacade.err(AaptProcess.java:332)    at com.android.utils.GrabProcessOutput$1.run(GrabProcessOutput.java:104)

爱奥尼资讯

  

离子:

   ionic (Ionic CLI)  : 4.2.1 (/home/trip/.nvm/versions/node/v9.2.0/lib/node_modules/ionic)    Ionic Framework    : ionic-angular 3.9.2    @ionic/app-scripts : 3.1.8

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)    Cordova Platforms     : android 7.1.0, ios 4.5.4    Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview
1.2.1, (and 26 other plugins)

System:

   Android SDK Tools : 26.1.1 (/home/trip/Android/Sdk)    NodeJS       : v9.2.0 (/home/trip/.nvm/versions/node/v9.2.0/bin/node)    npm        : 5.5.1    OS                : Linux 4.15

我尝试将这三个属性添加到文件/home/trip/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0.aar/8982e9a5aeacb8b77f78fc202fe2ff0a/res/values-v28/values-v28.xml中,在其中搜索它们,但错误仍然存​​在。有人知道我该如何正确地包含它们,或者他还有其他解决方案吗?

更新5/12/2018

我设法通过指向较新的对讲机版本(6.0.0)解决了此问题。对讲插件最有可能指向幕后事物。

  • ionic cordova平台rm android
  • ionic cordova平台添加android
  • ionic cordova插件添加cordova-plugin.intercom@6.0.0

3 个答案:

答案 0 :(得分:3)

您不能修改AAR,因为它只是从maven下载的AAR的缓存。

问题是App Compat库版本28+需要编译SDK级别28(这就是为什么您应该始终使库版本与SDK级别匹配)。将您的编译和目标SDK升级到28,所有程序都可以正常编译。

答案 1 :(得分:0)

如果您是由于最近在以前可以正常运行的错误中偶然发现此错误而遇到此问题的,则 反应本机项目 -这是由于最新的BREAKING CHANGE在Google Play服务和Firebase中。特别是依赖于-

的软件包会出现问题。
  

com.google.android.gms:play-services-gcm

首先检查该线程-

https://github.com/facebook/react-native/issues/25293

解决方案通常是这样-

https://github.com/facebook/react-native/issues/25293#issuecomment-503045776

答案 2 :(得分:0)

对我来说,此问题已通过在SDK Manager中安装相应的android SDK平台工具并重新运行npm install然后再运行ionic cordova build android来解决。 enter image description here