Jetifier does not convert support dependencies
我在本地克隆了 ExoPlayer,并使用我的
1 2 3 | gradle.ext.exoplayerRoot = 'path/to/exoplayer' gradle.ext.exoplayerModulePrefix = 'exoplayer-' apply from: new File(gradle.ext.exoplayerRoot, 'core_settings.gradle') |
每当我尝试构建项目时,都会收到以下构建错误:
error: package android.support.annotation does not exist
ExoPlayer 模块中的所有
我在 Android Studio 3.2.1 中创建了一个新项目,在我的
build.gradle
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 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
1 2 3 4 | org.gradle.jvmargs=-Xmx1536m android.databinding.enableV2=true android.useAndroidX=true android.enableJetifier=true |
如果我理解正确,Jetifier 应该能够解析支持依赖并将其转换为 AndroidX 依赖,但这些本地模块似乎并非如此。
我通过为应用程序中使用的项目中的每个本地 exoplayer 模块指定一个
1 2 3 4 5 | # 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 |