SelfLender / react-native-biometrics

React Native module for iOS and Android biometrics
MIT License
664 stars 228 forks source link

Exception in HostObject::get for prop 'ReactNativeBiometrics': java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/biometric/BiometricPrompt$PromptInfo; #280

Open batu0b opened 9 months ago

batu0b commented 9 months ago

I get this error when I import the library, I can't find a solution, can you help me?

import ReactNativeBiometrics, {BiometryTypes} from 'react-native-biometrics';
  const testBiometric = async () => {
    const rnBiometrics = new ReactNativeBiometrics({
      allowDeviceCredentials: true,
    });

    const {biometryType} = await rnBiometrics.isSensorAvailable();

    if (biometryType === BiometryTypes.Biometrics) {
      console.log('test');
    }
  };

I used it to test this way but as soon as I import ReactNativeBiometrics this issue appears

Exception in HostObject::get for prop 'ReactNativeBiometrics': 
java.lang.NoClassDefFoundError:
Failed resolution of: Landroidx/biometric/BiometricPrompt$PromptInfo;