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

RN 0.60.0: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null #149

Closed
Riant opened this issue Jul 5, 2019 · 4 comments
Closed

RN 0.60.0: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null #149

Riant opened this issue Jul 5, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@Riant
Copy link

Riant commented Jul 5, 2019

Current behavior

Build Successful, but always got error like below even after I run react-native link @react-native-community/async-storage.

For RN 0.60.0, we do not need to run the link command for native modules, so i get error after I run react-native link ...:

error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
  - @react-native-community/async-storage (to unlink run: "react-native unlink @react-native-community/async-storage")

Expected behavior

For RN 0.60.0, we do not need to run the link command for native modules.

Repro steps

Init a project with react-native 0.60.0 ...

Environment

  • Async Storage version: 1.5.0
  • React-Native version: 0.60.0
  • Platform tested: Android
  • Logs/Error that are relevant:
    [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null. To fix this issue try these steps: - Run 'react-native link @react-native-community/async-storage' in the project root. - Rebuild and restart the app. ...

So what should I do to fix that for 0.60.

Thanks.

@Riant
Copy link
Author

Riant commented Jul 5, 2019

Ah, it looks like because the react-native-cli autolinking error: :ReactNative:Automatic import of native modules failed. react-native-community/cli#470

@krizzu krizzu added bug Something isn't working LEGACY labels Jul 5, 2019
@thymikee
Copy link

thymikee commented Jul 5, 2019

The error tells you to unlink manually linked modules if using autolinking (this module is supported, but the docs are not updated yet), so they don't collide and cause issues in future when upgrading. Can we make it more readable for you?

@dhei
Copy link

dhei commented Jul 9, 2019

I ran into the same error AsyncStorage is null error when migrating our test app to RN 0.60.0 today.

I resolved the issue by running react-native unlink @react-native-community/async-storage and cd ios && pod install again.

@krizzu
Copy link
Member

krizzu commented Jul 9, 2019

Hope that unlink fixed it for ya, @Riant . Going to add instructions in the docs for RN 0.60+

@krizzu krizzu closed this as completed Jul 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants