I cloned ExoPlayer locally and added the modules to my existing project using my settings.gradle
as described in the documentation:
gradle.ext.exoplayerRoot = 'path/to/exoplayer'
gradle.ext.exoplayerModulePrefix = 'exoplayer-'
apply from: new File(gradle.ext.exoplayerRoot, 'core_settings.gradle')
Whenever I try to build the project, I receive the following build error:
error: package android.support.annotation does not exist
These happen for all @NonNull
and @Nullable
annotations in the ExoPlayer modules.
I created a new project in Android Studio 3.2.1, added AndroidX support in my gradle.properties
file and updated my build.gradle
file accordingly.
build.gradle
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 26
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
dataBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//ExoPlayer
implementation project(':exoplayer-library-core')
}
gradle.properties
org.gradle.jvmargs=-Xmx1536m
android.databinding.enableV2=true
android.useAndroidX=true
android.enableJetifier=true
If I understand correctly, Jetifier should be able to resolve and convert the support dependencies to AndroidX dependencies, but this does not seem to be the case for these local modules.