错误打印:
Error: cmd: Command failed with exit code 1 Error output:
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontWeight
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:ttcIndex
项目本来一直运行得好好的,突然周一上班来运行时报了以上的错误,代码什么的都没变,原因只能在环境上,可能某个环境偷偷进行了更新,然而,我却并没有察觉。
各种寻找资料,尝试过许多方法,最后如下操作解决了我的难题。
解决:在platform下的build.gradle最前面加上如下代码(理由是将全局所有用到的V4包改成23+)
apply plugin: 'com.android.application'
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'com.android.support') {
details.useVersion "23+"
}
}
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'com.android.support') {
details.useVersion "23+"
}
}
}}
结果:运行打包成功。
后续:这只是一个治标不治本的方法,在没找到更好办法以前,可能每次构建platform/android的时候,都需要加上以上代码。
(本文原创,如有疑问可提出异议)