【发布时间】:2020-01-17 23:56:55
【问题描述】:
我在 gradle.properties 上设置了 android.useAndroidX = true 和 android.enableJetifier = true。但是当我运行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?
【问题讨论】:
标签: android react-native gradlew android-jetifier