解决ionic3出现unable to find attribute android:font

错误打印:

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+"
        }
    }
}}

结果:运行打包成功。

后续:这只是一个治标不治本的方法,在没找到更好办法以前,可能每次构建platform/android的时候,都需要加上以上代码。

(本文原创,如有疑问可提出异议)


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值