我已经设置android.useAndroidX = true
并android.enableJetifier = true
在 gradle.properties 上。但是当我跑步时,react-native run-android
我看到:
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1902 file(s) to forward-jetify. Using 4 workers...
但是当我将 dir 更改为 android dir 并运行./gradlew assembleDebug
时,我没有看到这样的东西。android.support.*
因此,我的构建在导入库的任何地方都会中断。
> Task :react-native-app-auth:compileDebugJavaWithJavac FAILED
.../node_modules/react-native-app-auth/android/src/main/java/com/rnappauth/
RNAppAuthModule.java:10: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
^
.../node_modules/react-native-app-auth/android/src/main/java/com/rnappauth/RNAppAuthModule.java:11: error: cannot find symbol
import android.support.customtabs.CustomTabsCallback;
^
symbol: class CustomTabsCallback
location: package android.support.customtabs
.../node_modules/react-native-app-auth/android/src/main/java/com/rnappauth/RNAppAuthModule.java:12: error: cannot find symbol
import android.support.customtabs.CustomTabsClient;
^
symbol: class CustomTabsClient
location: package android.support.customtabs
(25 more errors)
为什么会这样?我怎样才能解决这个问题?有没有办法从外部强制 gradlew 运行 jetifier?