Article directory
1. Error record
Compile and run the source code of ijkplayer, the following error is reported, the source code is relatively old, the source code of 2018;
After compiling in Ubuntu, use Android Studio to run the source code in Windows;
Error message:
All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html
Affected Modules: ijkplayer-example
Configuration 'all64Compile' is obsolete and has been replaced with 'all64Implementation' and 'all64Api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: ijkplayer-example
Configuration 'all32Compile' is obsolete and has been replaced with 'all32Implementation' and 'all32Api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: ijkplayer-example
Two, the solution
Let me simply translate it first:
All Flavors must now belong to a named Flavor dimension. More info at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html
Affected modules: ijkplayer-example
Configuration 'all64Compile' is obsolete and has been replaced by 'all64Implementation' and 'all64Api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected modules: ijkplayer-example
Configuration 'all32Compile' is obsolete and has been replaced by 'all32Implementation' and 'all32Api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected modules: ijkplayer-example
Add flavorDimensions "minSdkVersion" above productFlavors, and specify the latitude of setting as the minimum SDK version number;
android {
flavorDimensions "minSdkVersion"
productFlavors {
all32 { minSdkVersion 21 }
all64 { minSdkVersion 21 }
// armv5 {}
// armv7a {}
// arm64 { minSdkVersion 21 }
// x86 {}
}
}
Set all dependencies to: change from compile dependencies to implementation dependencies;
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:23.0.1'
implementation 'com.android.support:preference-v7:23.0.1'
implementation 'com.android.support:support-annotations:23.0.1'
implementation 'com.squareup:otto:1.3.8'
implementation project(':ijkplayer-java')
implementation project(':ijkplayer-exo')
implementation project(':ijkplayer-armv5')
implementation project(':ijkplayer-armv7a')
implementation project(':ijkplayer-x86')
implementation project(':ijkplayer-armv5')
implementation project(':ijkplayer-armv7a')
implementation project(':ijkplayer-arm64')
implementation project(':ijkplayer-x86')
implementation project(':ijkplayer-x86_64')
}