enableJetifier 不适用于图书馆项目

enableJetifier not working for library project

我的新 kotlin 项目默认使用 androidx,在根项目的 gradle.properties 中配置了 android.useAndroidX=true & android.enableJetifier=true。但它也依赖于使用 support.v4 库的模块库。

Jetifier 不应该自动将这些依赖项转换为 androidx 吗? 为什么我仍然收到此错误:

error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;

error: cannot find symbol
   @DrawableRes int resId,
                                              ^
  symbol:   class DrawableRes
  location: class BitmapUtil

error: package android.support.annotation does not exist
import android.support.annotation.ColorRes;

error: cannot find symbol
    public static GDWrapper rect(@ColorRes int colorId, float... radii) {
                                  ^
  symbol:   class ColorRes
  location: class XmlDrawableUtil

Jetifier 仅适用于 Maven 的依赖项(即 build.gradle 文件的 dependencies 块中的一行);它不适用于您项目中的其他模块。

您项目中的每个模块都需要同时迁移到AndroidX。