Android日常开发(37)API27引入ExoPlayer2.11.4项目报错处理

在将ExoPlayer2.11.4引入Android API27的旧项目时,遇到resource android:attr/fontVariationSettings找不到的错误,以及Manifest合并失败的问题。解决方法包括将编译版本升级到28,以及处理Androidx core包与Support包的冲突。但直接移除ExoPlayer对core包的依赖会导致编译失败,建议回退ExoPlayer版本到2.9.5。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.错误提示:error: resource android:attr/fontVariationSettings not found
解决办法:
把编译版本由27改成28就好了:

compileSdkVersion 28
defaultConfig {
applicationId “com.xxx”
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName “1.0”
testInstrumentationRunner “android.support.test.runner.AndroidJUnitRunner”
}

2.错误提示:Manifest merger failed with multiple errors, see logs
解决办法:点击下图中gradle命令查看具体问题原因
在这里插入图片描述

原因是因为ExoPlayer里面引入了Androidx的core包跟Support包中的类冲突了,解决办法是剔除ExoPlayer对core包的依赖

implementation ('com.google.android.exoplayer:exoplayer:2.11.4'){
        exclude group:'androidx.core',module:'core'
    }

具体请参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值