Skip to content

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

@MiguelNiblock

Description

@MiguelNiblock

What happened?

Using the react-native cli, this error happens with a clean install of react-native and asyncStorage. Running on linux and android.

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

What I've tried:

  • react-native link @react-native-async-storage/async-storage and nothing changed.

I've seen many other issues with this, but no clear solutions other than that one. Is this library actually being maintained? I see a lot of projects depending on it and having issues too. Including the aws amplify library. Oh my!

Version

1.15.9

What platforms are you seeing this issue on?

  • Android
  • iOS
  • macOS
  • Windows
  • web

System Information

System:
    OS: Linux 5.10 Manjaro Linux
    CPU: (4) x64 Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz
    Memory: 860.66 MB / 19.30 GB
    Shell: 5.1.8 - /bin/bash
  Binaries:
    Node: 12.22.1 - ~/.nodenv/versions/12.22.1/bin/node
    Yarn: 1.22.11 - /usr/bin/yarn
    npm: 6.14.12 - ~/.nodenv/versions/12.22.1/bin/npm
    Watchman: 20210821.022905.0 - /usr/bin/watchman
  SDKs:
    Android SDK: Not Found
  IDEs:
    Android Studio: AI-203.7717.56.2031.7678000
  Languages:
    Java: 11.0.12 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.66.0 => 0.66.0 
  npmGlobalPackages:
    *react-native*: Not Found

Steps to Reproduce

The steps to reproduce are:

  1. npx react-native init MyApp --template react-native-template-typescript
  2. yarn add @react-native-async-storage/async-storage at the time of this writing, happened with version 1.15.9.
  3. Import and use as normal. I.e:
import AsyncStorage from '@react-native-async-storage/async-storage';

const storeData = async (value) => {  try {    await AsyncStorage.setItem('@storage_Key', value)  } catch (e) {    // saving error  }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions