【发布时间】:2020-04-20 14:28:41
【问题描述】:
我安装了一个名为 react-native-imei 的库。安装后,我已将此库与 React Native 链接,例如 react-native link react-native-imei。在我运行项目之后,我遇到了错误。错误如下所述。
> Task :react-native-imei:compileDebugJavaWithJavac
> Task :realm:forwardDebugPort
8083
> Task :app:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
329 actionable tasks: 22 executed, 307 up-to-date
Note: /home/zain/Desktop/Kolachi/demo/pos-proto/node_modules/react-native-imei/android/src/main/java/codes/simen/IMEI/RNImeiModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
* daemon not running; starting now at tcp:5037
* daemon started successfully
/home/zain/Desktop/Kolachi/demo/pos-proto/android/app/src/main/java/com/resturantapp/MainApplication.java:82: error: incompatible types: MainReactPackage cannot be converted to int
packages.add(new MainReactPackage(),
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
FAILURE: Build failed with an exception.
【问题讨论】:
-
你能告诉我你现在使用的是哪个版本的 react native 吗?在我的情况下,这个包运行成功。
-
"react-native": "0.60.5"
标签: javascript reactjs react-native npm react-native-android