Async-storage: Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null

Created on 3 Feb 2020  ·  12Comments  ·  Source: react-native-async-storage/async-storage

When I run npm start the following error is generated.

Details:

  • I have already tried running npx react-native link @react-native-community/async-storage and restarted the build with all the options shown in the screen.

while running pod install there are still errors
- ERROR | attributes: Missing required attributehomepage. - WARN | source: The version should be included in the Git tag. - WARN | description: The description is equal to the summary.

image

Can anyone help, what's wrong with the steps?

Most helpful comment

Same here.
"react-native": "0.61.5",

EDIT

using use_native_modules! on pod worked!

All 12 comments

@nikeshk Hey,

What RN version you use?

Same here.
"react-native": "0.61.5",

EDIT

using use_native_modules! on pod worked!

@Krizzu
The react-native version is:
"react-native": "0.61.5"

@luco How can I use native_framework ??

@nikeshk
With version 0.60+, you should not use link feature, because there's auto-linking in place. Please checkout the RN template's Podfile and compare it with yours. use_native_modules! makes auto-linking work (remember to import it through require_relative at the top of the file).

@nikeshk I'm sorry, I miswrote it. It's use_native_modules!. You should put it before the end section of your target on your podfile.

I have this error when trying to debug a RN app in Expo on Android.

I don't have a podfile to use a use_native_modules! line in (podfiles are for iOS only, afaik).

I'm having the same exact issue.

I installed same version as you for react native.

Here's my package.json
{
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"web": "expo start --web",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@react-native-community/async-storage": "^1.8.0",
"@signalwire/react-native": "^1.0.1",
"expo": "~36.0.0",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-native": "~0.61.5",
"react-native-gesture-handler": "~1.5.0",
"react-native-incall-manager": "^3.2.7",
"react-native-reanimated": "~1.4.0",
"react-native-screens": "2.0.0-alpha.12",
"react-native-unimodules": "~0.7.0",
"react-native-web": "~0.11.7",
"react-native-webrtc": "^1.75.3"
},
"devDependencies": {
"@babel/core": "~7.6.0",
"babel-jest": "~24.9.0",
"jest": "~24.9.0",
"metro-react-native-babel-preset": "~0.56.0",
"react-test-renderer": "~16.9.0"
},
"jest": {
"preset": "react-native"
},
"private": true
}
and I added the use_native_modules! right before end, then stopped and expo started and still same issue.

Added use_native_modules! at the end. Added require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' right in the beginning of the Podfile. Getting a ld: 520 duplicate symbols for architecture x86_64 error in xcode on build :/

react-native version 0.61.4

  • add this in Podfile : pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'
  • cd ios && pod install

Having this issue on Android, how can I fix it ?
using rn 0.61.5 and @react-native-community/async-storage 1.7.1

@nikeshk
With version 0.60+, you should not use link feature, because there's auto-linking in place. Please checkout the RN template's Podfile and compare it with yours. use_native_modules! makes auto-linking work (remember to import it through require_relative at the top of the file).

where to use-native-modules exact place for andriod rn version 0.61.5 and where to import require relative exact place and line

@jessegranger were you able to solve the issue. I am also testing on android and there's no podfile for android to work on.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

burhanahmed92 picture burhanahmed92  ·  27Comments

cpojer picture cpojer  ·  34Comments

santhanakrishnanstark picture santhanakrishnanstark  ·  67Comments

StevenMasini picture StevenMasini  ·  22Comments

alex-mironov picture alex-mironov  ·  71Comments