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'
}
具体请参考链接
纠正,事后发现直接剔除依赖会导致编译不通过,这里的方案并不可取,在查阅了一些资料之后,建议还是对ExoPlayer进行版本回退到2.9.5
在将ExoPlayer2.11.4引入Android API27的旧项目时,遇到resource android:attr/fontVariationSettings找不到的错误,以及Manifest合并失败的问题。解决方法包括将编译版本升级到28,以及处理Androidx core包与Support包的冲突。但直接移除ExoPlayer对core包的依赖会导致编译失败,建议回退ExoPlayer版本到2.9.5。
1028

被折叠的 条评论
为什么被折叠?



