Search code examples
androidreact-nativedependencies

Execution failed for task ':react-native-lock:compileDebugJavaWithJavac'


My app's build fails because of react-native-lock which is a deprecated library. But this happens in android only. It builds and runs successfully on iOS. It gives the following error:

Task :react-native-lock:compileDebugJavaWithJavac FAILED /Users/abc/appname/node_modules/react-native-lock/android/src/main/java/com/auth0/lock/react/LockReactPackage.java:146: error: method does not override or implement a method from a supertype @Override ^ Note: /Users/abc/appname/node_modules/react-native-lock/android/src/main/java/com/auth0/lock/react/bridge/UserProfileBridge.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error

I am stuck over this issue for so long. Any help would be highly appreciated. Its app/build.gradle looks like this:

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')
}

My package.json dependencies are as follows:

"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"
  },

Its project level build.gradle:

dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
        classpath 'com.google.gms:google-services:4.0.1'
    }

The gradle version which I am using is 4.9. The JDK version is 11.


Solution

  • Are you using this depreciated library for Biometrics?