android studio导入ijkplayer源码例子出现错误

最近在研究ijkplayer源码,改源码经常改的例子不能用,删掉源码再编译很多次,顺便记录一下

版本android studio3.0.1

Error:A problem occurred configuring project ':ijkplayer-example'.

> All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html

在网上查了查,只要在ijkplayer-example的build.gradle的defaultConfig内添加flavorDimensions

defaultConfig {
    applicationId "tv.danmaku.ijk.media.example"
    minSdkVersion 9
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode rootProject.ext.versionCode
    versionName rootProject.ext.versionName
    flavorDimensions "800400"
}
后面的值最好和版本好一样,版本号在ijkplayer下的build.gradle内

ext {
    compileSdkVersion = 26
    buildToolsVersion = "26.0.2"

    targetSdkVersion = 26

    versionCode = 800400
    versionName = "0.8.4"
}
Error:error: '@@array/pref_entries_player' is incompatible with attribute android:entries (attr) reference.

这个错误只要找到这段代码的位置删除一个@,改成@array/pref_entries_player然后重启android studio,因为make project没用只能重启



猜你喜欢

转载自blog.csdn.net/u010302327/article/details/79168721