react-native-async-storage / async-storage

An asynchronous, persistent, key-value storage system for React Native.

Home Page:https://react-native-async-storage.github.io/async-storage/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

another @RNC/AsyncStorage]: NativeModule: AsyncStorage is null

oshaleyko59 opened this issue · comments

What happened?

Android Bundling complete 10043ms - just after completing build with eas and then trying to start app on Android, it crashes with error (rebuil-restart tried - no help, the same app works on Expo Go without any issue ):

ERROR Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.

To fix this issue try these steps:

• Rebuild and restart the app.

• Run the packager with --reset-cache flag.

• If you are using CocoaPods on iOS, run pod install in the ios directory and then rebuild and re-run the app.

• If this happens while testing with Jest, check out docs how to
integrate AsyncStorage with it: https://react-native-async-storage.github.io/async-storage/docs/advanced/jest

If none of these fix the issue, please open an issue on the Github
repository: https://github.com/react-native-async-storage/async-storage/issues
, js engine: hermes
ERROR Invariant Violation: "main" has not been registered. This can happen if:

  • Metro (the local dev server) is run from the wrong folder. Check
    if Metro is running, stop it and restart it in the current project.* A module failed to load due to an error and AppRegistry.registerComponent wasn't called., js engine: hermes

Version

no dependancy on @react-native-async-storage/async-storage

What platforms are you seeing this issue on?

  • Android
  • iOS
  • macOS
  • Windows
  • web

System Information

info Fetching system and libraries information...
System:
  OS: Windows 10 10.0.19045
  CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
  Memory: 5.48 GB / 15.81 GB
Binaries:
  Node:
    version: 18.16.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn: Not Found
  npm:
    version: 9.5.1
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: AI-222.4459.24.2221.10121639
  Visual Studio: Not Found
Languages:
  Java:
    version: 11.0.17
    path: C:\Program Files\Common Files\Oracle\Java\javapath\javac.EXE
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.3
    wanted: 0.72.3
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Steps to Reproduce

it just happens with my environment - as far as i understand searching for the same, there is no clear understanding how to reproduce it

Please see if #994 (comment) helps:

I don't know if Expo autolinks native modules the same way vanilla React Native does, but assuming it does, you need to explicitly take dependency on AsyncStorage if any of your dependencies need it. Autolinking only links native modules that are found in the current project's package.json.

same error😟

Please see if #994 (comment) helps:

I don't know if Expo autolinks native modules the same way vanilla React Native does, but assuming it does, you need to explicitly take dependency on AsyncStorage if any of your dependencies need it. Autolinking only links native modules that are found in the current project's package.json.

Yes!
I did install react-native-async-storage/async-storage, even not using directly (but Firebase uses it) and it helped. However, I would expect the third-party dependencies are taken careof ...

I did install react-native-async-storage/async-storage, even not using directly (but Firebase uses it) and it helped. However, I would expect the third-party dependencies are taken careof ... Expo itself runs perfectly without it