【发布时间】:2020-10-13 14:25:19
【问题描述】:
我的应用构建失败,因为 react-native-lock 是一个已弃用的库。但这仅在android中发生。它在 iOS 上成功构建和运行。它给出了以下错误:
任务:react-native-lock:compileDebugJavaWithJavac FAILED /Users/abc/appname/node_modules/react-native-lock/android/src/main/java/com/auth0/lock/react/LockReactPackage.java:146:错误:方法没有覆盖或实现超类型中的方法 @覆盖 ^ 注意:/Users/abc/appname/node_modules/react-native-lock/android/src/main/java/com/auth0/lock/react/bridge/UserProfileBridge.java 使用未经检查或不安全的操作。 注意:使用 -Xlint:unchecked 重新编译以获取详细信息。 1 个错误
我被这个问题困扰了很久。任何帮助将不胜感激。它的 app/build.gradle 看起来像这样:
dependencies {
compile project(':realm')
implementation project(':realm')
compile project(':react-native-vector-icons')
implementation project(':react-native-vector-icons')
compile project(':react-native-lock')
implementation project(':react-native-lock')
compile project(':react-native-firebase')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':react-native-firebase')
}
我的package.json依赖如下:
"dependencies": {
"@expo/ex-navigation": "^3.1.0",
"babel-preset-react-native-stage-0": "^1.0.1",
"firebase": "^4.8.0",
"moment": "^2.22.1",
"react": "16.0.0",
"react-moment": "^0.7.0",
"react-native": "0.55.0",
"react-native-firebase": "^5.2.3",
"react-native-loading-spinner-overlay": "^0.5.2",
"react-native-lock": "^0.4.0",
"react-native-popup-dialog": "^0.16.6",
"react-native-step-indicator": "0.0.7",
"react-native-swipe-list-view": "^1.3.1",
"react-native-vector-icons": "^4.4.2",
"react-redux": "^5.0.6",
"realm": "^10.0.0-beta.6",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0"
},
它的项目级build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:4.0.1'
}
我使用的 gradle 版本是 4.9。 JDK 版本为 11。
【问题讨论】:
标签: android react-native dependencies