[Android] NativeModule: AsyncStorage is null when try autolinking.
See original GitHub issueCurrent behavior
yarn add @react-native-community/async-storage
and
react-native run-andoid
and this error is shown.
Hint
When I link it manually, https://github.com/react-native-community/async-storage/blob/LEGACY/docs/Linking.md#android
it works fine.
but this error is shown on the console.
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")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Expected behavior
autolinking works.
Repro steps
yarn add @react-native-community/async-storage
react-native run-andoid
Environment
- Async Storage version : 1.6.1
- React-Native version: 0.60.5
- Platform tested: Android
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:10 (3 by maintainers)
Top Results From Across the Web
[Android] NativeModule: AsyncStorage is null when try ...
it works fine. but this error is shown on the console. error React Native CLI uses autolinking for native dependencies, but the following ......
Read more >react native - NativeModule: AsyncStorage is null, with @RNC ...
I run my app in the Simulator/Emulator (and device) through the Expo app. Once I tried ejecting and there were problems. So, I...
Read more >null is not an object (evaluating 'rnfsmanager.rnfsfiletyperegular')
In case of iOS message is 'Native module cannot be null', In Android message is 'null is not an object evaluating RNFSManager etc'....
Read more >react-native-community/async-storage - npm
An asynchronous, unencrypted, persistent, key-value storage system for React Native. Supported platforms. iOS; Android; Web · MacOS · Windows ...
Read more >NativeModule: AsyncStorage is null EXPO EAS app - Reddit
i am having this issue for a while. To fix this issue try these steps: • Rebuild and restart the app.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Got the same error. Doing a
cd android/ && ./gradlew clean
beforerun-android
fixed autolinking for me.@Krizzu It was the same, so I wanted to show you, so I unlinked them again, and edited the
MainApplication.java
then I ran it and it works just fine. What I think happend, that i did not unlink them properly before by react-native unlink, but just removed references frombuild.gradle
andMainApplication.java
. So maybe linking and unlinking helped. Still wandering what happened.