原文:添加cordova-plugin-file-opener2后,打包出错
报错如下:
* 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 7s
(node:7000) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 1): Error: cmd: Command failed with exit code 1 Error output:
C:\Users\Administrator\.gradle\caches\transforms-1\files-1.1\support-compat-28.0
.0-alpha1.aar\958f18514ef6665a8a428677fe3825c9\res\values\values.xml:20:5-70: AA
PT: error: resource android:attr/fontVariationSettings not found.
C:\Users\Administrator\.gradle\caches\transforms-1\files-1.1\support-compat-28.0
.0-alpha1.aar\958f18514ef6665a8a428677fe3825c9\res\values\values.xml:20:5-70: AA
PT: error: resource android:attr/ttcIndex not found.
D:\cordova\workspace\bbb\platforms\android\app\build\intermediates\incremental\m
ergeDebugResources\merged.dir\values\values.xml:86: error: resource android:attr
/fontVariationSettings not found.
D:\cordova\workspace\bbb\platforms\android\app\build\intermediates\incremental\m
ergeDebugResources\merged.dir\values\values.xml:86: error: resource android:attr
/ttcIndex not found.
error: failed linking references.
此问题基本是grade版本冲突问题,本人找到的解决方法是,在打包目录下与**\platforms\android\app,在与build.gradle同一级目录下,创建文件,名称为build-extras.gradle,内容为
configurations.all {
? ? resolutionStrategy {
? ? ? ? force ‘com.android.support:support-v4:27.1.0‘
? ? }
}
原文地址:https://www.cnblogs.com/lonelyxmas/p/10230922.html