完整报错信息
Error: /Users/**/platforms/android/gradlew: Command failed with exit code 1 Error output:
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:ttcIndex
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processReleaseResources'.
> com.android.ide.common.process.ProcessException: 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.
网上的一些方法是升级相关的一些编译SDK,报错的原因是平台版本的不兼容,我这里的解决方案是降级处理, 同样达到效果。
解决方案
经过查看之前的android版本是6.3.0 ,$
cordova platform ls
Installed platforms: android 6.3.0 ios 4.3.1
备份platform/android文件夹 (目的是不会被降级操作覆盖之前对项目的设置)
开始降级处理:
cordova platform update android@6.2.3
从备份的文件夹中恢复之前的所有设置
重新打包,编译正常,ok