question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[@RNC/AsyncStorage]: NativeModule: AsyncStorage is null (0.61.5)

See original GitHub issue

I upgraded react-native from 0.59.8 to 0.61.5 Unlinked @react-native-community/async-storage App builds successfully and splash screen comes. After that it says (In Android):

[@RNC/AsyncStorage]: NativeModule: AsyncStorage is null
- Run react-native link @react-native-community/async-storage

When I tried linking it says:

info Linking "@react-native-community/async-storage" iOS dependency
error Linking "@react-native-community/async-storage" failed. 

If I try unlinking again (I already did before as I encountered error while upgrading), it says

info iOS module "@react-native-community/async-storage" is not installed
info Android module "@react-native-community/async-storage" is not installed

Why does it say @react-native-community/async-storage is not installed even after I installed the package? I tried removing the package and installing again. Same errors

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:25 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
Arjoriecommented, Jan 15, 2020

I’m facing the same problem I am using 0.61 of react-native and I’m using expo. So it should link automatically but it didn’t work, so I tried to unlink but it says that it is not installed. So I tried linking it manually and I found out that some of my android files is missing.

debug Available platforms: iOS, Android debug Package to link: @react-native-community/async-storage info Linking “@react-native-community/async-storage” Android dependency debug Patching D:\Work Files\Freelance\knoCard\android\settings.gradle error Linking “@react-native-community/async-storage” failed. Error: ENOENT: no such file or directory, open ‘D:\Work Files\Freelance\knoCard\android\settings.gradle’ at Object.openSync (fs.js:440:3) at Object.readFileSync (fs.js:342:35) at applyPatch (D:\Work Files\Freelance\knoCard\node_modules@react-native-community\cli-platform-android\build\link\patches\applyPatch.js:42:51) at Object.registerNativeAndroidModule [as register] (D:\Work Files\Freelance\knoCard\node_modules@react-native-community\cli-platform-android\build\link\registerNativeModule.js:31:27) at D:\Work Files\Freelance\knoCard\node_modules\react-native\node_modules@react-native-community\cli\build\commands\link\linkDependency.js:63:16 at Array.forEach () at linkDependency (D:\Work Files\Freelance\knoCard\node_modules\react-native\node_modules@react-native-community\cli\build\commands\link\linkDependency.js:36:32) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async Object.link [as func] (D:\Work Files\Freelance\knoCard\node_modules\react-native\node_modules@react-native-community\cli\build\commands\link\link.js:107:5) at async Command.handleAction (D:\Work Files\Freelance\knoCard\node_modules\react-native\node_modules@react-native-community\cli\build\index.js:164:9)

Are you guys don’t have the same files inside your android folder except for app folder?

Now I know why I dont have android folder files, I am Using Expo and it does not support native modules like async-storage because it will look for setting.gradle or other files inside your android folder or ios folder. See https://facebook.github.io/react-native/docs/getting-started at Caveats

In other words, we need to use react-native eject or expo eject

1reaction
sumanthyedoticommented, Jan 29, 2020

@Krizzu Thanks, it removed the error. (But a lot of dependencies kept showing errors one after another. It’s a production app. So I created new project and migrated code to move fast)

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native - NativeModule: AsyncStorage is null, with @RNC ...
To fix this issue try these steps: -Run `react-native link @react-native-community/async-storage` in the project root. -Rebuild and restart the ...
Read more >
NativeModule: AsyncStorage is null · Issue #768 - GitHub
Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null. To fix this issue try these steps: • Rebuild and restart the app.
Read more >
ERROR Error: [@RNC/AsyncStorage]: NativeModule - Medium
ERROR Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null. Rebuild and restart the app. Run the packager with '--reset-cache' flag.
Read more >
Expo/React-native AsyncStorage.getItem() resolves to null ...
Coding example for the question Expo/React-native AsyncStorage.getItem() resolves to null-React Native.
Read more >
Active questions tagged react-native+ios - Stack Overflow
Next react-native-ffmpeg: Native module cannot be null (ios) and null is not an ... After updating to React Native 0.61.5 I am having...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found