Android Jetifier不转换支持依赖项
我在本地进行了克隆,并使用我的Android Jetifier不转换支持依赖项,android,exoplayer,android-jetifier,Android,Exoplayer,Android Jetifier,我在本地进行了克隆,并使用我的设置将模块添加到现有项目中。gradle如文档中所述: gradle.ext.exoplayerRoot = 'path/to/exoplayer' gradle.ext.exoplayerModulePrefix = 'exoplayer-' apply from: new File(gradle.ext.exoplayerRoot, 'core_settings.gradle') 每当我尝试构建项目时,都会收到以下构建错误: 错误:程序包android.sup
设置将模块添加到现有项目中。gradle
如文档中所述:
gradle.ext.exoplayerRoot = 'path/to/exoplayer'
gradle.ext.exoplayerModulePrefix = 'exoplayer-'
apply from: new File(gradle.ext.exoplayerRoot, 'core_settings.gradle')
每当我尝试构建项目时,都会收到以下构建错误:
错误:程序包android.support.annotation不存在
这些发生在ExoPlayer模块中的所有@NonNull
和@Nullable
注释中
我在Android Studio 3.2.1中创建了一个新项目,在我的gradle.properties
文件中添加了AndroidX支持,并相应地更新了我的build.gradle
文件
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
如果我理解正确,应该能够将支持依赖项解析并转换为AndroidX依赖项,但是这些本地模块似乎不是这样。我通过为应用程序中使用的项目中的每个本地exoplayer模块指定一个
gradle.properties
文件,成功地解决了这个问题。我仍然不知道是什么原因导致了这个问题,但是阻止Jetifier为本地模块迁移到AndroidX似乎可以解决这个问题
# Local module Gradle settings.
android.useAndroidX=false
# Jetifier will convert support libraries of all your dependencies to AndroidX automatically,
# if you don't set it true then your project will have both support
android.enableJetifier=false