Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null is not an object (evaluating 'RNKeychainManager.SECURITY_LEVEL_ANY') #66

Closed
tskorupka opened this issue Feb 18, 2019 · 26 comments
Closed

Comments

@tskorupka
Copy link
Contributor

tskorupka commented Feb 18, 2019

null is not an object (evaluating 'RNKeychainManager.SECURITY_LEVEL_ANY')

dependencies:
@haskkor/react-native-pincode#1.13.0
react-native-keychain#3.1.1

Image

@MrRefactor
Copy link

I've got same issue

@jeremy-farnault
Copy link
Contributor

Hi there,

I can't reproduce it. Did you link the libraries etc?

Cheers,
Jeremy

@MrRefactor
Copy link

Well, I've just reinstalled that today and its working, at monday I did it several times and it didnt work. Now working just fine.

@jeremy-farnault
Copy link
Contributor

Thanks for the feedback.
I'll leave this open and keep on investigating.

Cheers,
Jeremy

@tskorupka
Copy link
Contributor Author

@Haskkor try without permissions for fingerprint I think that fixed it in my case.

@wuno
Copy link

wuno commented Feb 25, 2019

On a fresh install I have this same issue. For my use case I do not want to use any of the other features. I just need a clean way of accepting a pin from a user.

The flow I am trying to accomplish is like this,

The first time a user uses the application -

  • User enters a pin.
  • User verifies the pin a second time.
  • I never store the pin on the phone and instead I encrypt some data in the mobile app with the pin.

The next time the user uses the mobile app I request their pin to decrypt their saved data -

  • Once the user's data is decrypted, they have access to use the mobile application as a logged in user.

On a fresh install, I see the error mentioned above,

Cannot read property 'SECURITY_LEVEL_ANY' of undefined

Example of usage,

npm install --save @haskkor/react-native-pincode

import PINCode from '@haskkor/react-native-pincode';

class Auth extends Component {
  render() {
    return (
      <Container style={styles.container}>
        <PINCode
          status="choose"
          finishProcess={async () => {
            this.props.navigation.navigate('someNewPage');
          }}
          maxAttempts={5}
          pinCodeVisible={true}
          storePin={pin => this._HandleStoredPin(pin)}
        />
      </Container>
    );
  }
}

@jeremy-farnault
Copy link
Contributor

Hey,

I'm so sorry to read that as I can't reproduce. Could any of you try to use a previous version (1.12.2 might be a good one) and tell me if it fixes the issue? If so, I'll rollback the changes and keep on investigating.

Thanks,
Jeremy

@athulmurali
Copy link

I installed it today and facing the same issue.

Once, I import the package I am getting this issue.
import PINCode from '@haskkor/react-native-pincode'

@kevinwolfcr
Copy link
Contributor

@Haskkor this is because this package is requiring react-native-keychain@^3.0.0-rc.3, I created PR #72 locking the version to the last stable version.

@jeremy-farnault
Copy link
Contributor

Thanks for that.
It's merged. Help it'll fix it for you all.

@nileshprajapati007444
Copy link

I have same error. can anyone help me to fix it ?

@kevinwolfcr
Copy link
Contributor

I have the same error. can anyone help me to fix it?

It is weird since dependency was locked on the PR I opened.

  • May you have a package-lock.json or a yarn.lock that may be still downloading the buggy version?
  • Did you upgrade to latest version of react-native-pincode?

@TchernyavskyDaniil
Copy link

I have same issue for new version of react-native-pincode

@gokulanath
Copy link

gokulanath commented Aug 20, 2019

I have the same issue in v1.21.1
react-native - v0.59.9

@k-varma
Copy link

k-varma commented Sep 26, 2019

I am getting same is in 0.61.0, But it was working fine in the same version yesterday, i have did some changes for iOS and reverted them, but still get the issue

@thaiphan
Copy link

thaiphan commented Oct 31, 2019

Have you guys tried running the following commands?

yarn add react-native-keychain
cd ios
pod install

@akhilsanker
Copy link

Hi @wuno ,
Have you solved the error?
I am facing the same error.

@akhilsanker
Copy link

Any solution?

@akhilsanker
Copy link

@tskorupka
Is this is working component??

@jeremy-farnault
Copy link
Contributor

Hi @akhilsanker
I'm really sorry to hear that you can't make it work. It's working fine for us and it's used by 50+ other repos...
I really don't know why some of you are experiencing this issue...

@fonderkin
Copy link

fonderkin commented Dec 20, 2019

Same problem
react-native-keychain 3.1.3
react-native 0.61.5
react-native-pincode 1.21.1 "

Solved
Manual installation of react-native-keychain helped

npm install react-native-keychain

@ftlno
Copy link

ftlno commented Jan 15, 2020

Same problem..
"react-native-keychain": "^4.0.5",
"react-native": "0.61.5",

I have tried automatic, cocoapods and manual install. iOS is building successfully. But when I import * as Keychain from 'react-native-keychain'; in RN, I am getting null is not an object (evaluating 'RNKeychainManager.SECURITY_LEVEL_ANY')

Please help :)

@EliaFederico
Copy link

It is because last version (1.21.1) did update again the dependency 'react-native-keychain' to 3.1.3.

I solved this problem downgrading this library to version 1.21.0 which uses 'react-native-keychain' v3.0.0

@jeremy-farnault
Copy link
Contributor

Is this solution working ok for all of you?
If so I'll downgrade keychain back to v3.0.0 😄
Thanks @EliaFederico

@cihanbas
Copy link

cihanbas commented Mar 5, 2020

I had same problem but when i installed react-native-keychain then this problem solved

@jeremy-farnault
Copy link
Contributor

I at last experienced this issue when upgrading keychain to 5.0.1.
However following this: oblador/react-native-keychain#221
And then the instructions on keychain:

Run yarn add react-native-keychain

1 a. Only for React Native <= 0.59: $ react-native link react-native-keychain and check MainApplication.java to verify the package was added. See manual installation below if you have issues with react-native link.

it fixed itself.
I don't know what else can cause this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests