当我尝试使用$ react-native run-android
.
> Task :react-native-device-info:compileDebugJavaWithJavac FAILED
/Users/user/Desktop/mobile/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java:31: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
^
/Users/user/Desktop/mobile/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java:838: error: cannot find symbol
@Nullable Object data) {
^
symbol: class Nullable
location: class RNDeviceModule
Note: /Users/ammiel/Desktop/mobile/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
FAILURE: Build failed with an exception.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-device-info:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
我已经 jetify 运行 postinstall 并且有
android.useAndroidX=true
android.enableJetifier=true
在我的 gradle.properties 中。
潜伏在许多页面/ github页面但没有成功:/任何帮助表示赞赏!
其他信息:
反应原生:0.59.10
反应本机设备信息:5.6.1