SelfLender / react-native-biometrics

React Native module for iOS and Android biometrics
MIT License
661 stars 225 forks source link

Error While Building App on Android on Windows or MacOS #202

Open Ashabu opened 2 years ago

Ashabu commented 2 years ago

On both Windows or MacOS when trying to build the android build with "npm run android" , getting the same error

Task :react-native-biometrics:compileDebugJavaWithJavac FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings 344 actionable tasks: 26 executed, 318 up-to-date Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 /node_modules/react-native-biometrics/android/src/main/java/com/rnbiometrics/ReactNativeBiometrics.java:167: error: cannot access IdentityCredential BiometricPrompt.CryptoObject cryptoObject = new BiometricPrompt.CryptoObject(signature); ^ class file for android.security.identity.IdentityCredential not found

proffnick commented 2 years ago

Same error. Any solution from your end @Ashabu ?

Ashabu commented 2 years ago

Same error. Any solution from your end @Ashabu ?

Nop. Unfortunately still facing the same problem

proffnick commented 2 years ago

In your bundle.gradle /android/bundle.gradle, set compileSdkVersion = 30 // increase this

clean cache and restart. It worked for me.

jayfunk commented 2 years ago

Odd. I have been using this library with compileSdkVersion 29 without problems.

rnz269 commented 1 year ago

bumping my compileSdkVersion from 29 to 31 worked for me

devDoubleH commented 1 year ago

I think this error is because of java version react native requires at least Java 8