Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Problem occured update project : AsyncStorage has been removed from react-native core. #955

Closed
1 of 5 tasks
hkrvikrant opened this issue Apr 6, 2023 · 17 comments
Closed
1 of 5 tasks
Labels
bug Something isn't working

Comments

@hkrvikrant
Copy link

What happened?

getting this issue when i'm trying to update one of my project.

image

Version

1.17.11

What platforms are you seeing this issue on?

  • Android
  • iOS
  • macOS
  • Windows
  • web

System Information

System:
    OS: Windows 10 10.0.22621
    CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
    Memory: 2.02 GB / 7.84 GB
  Binaries:
    Node: 16.17.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.15.0 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK:
      API Levels: 28, 29, 30, 31, 32, 33
      Build Tools: 28.0.3, 30.0.2, 30.0.3, 31.0.0, 33.0.0
      System Images: android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-31 | Intel x86 Atom_64, android-31 | Google APIs Intel x86 Atom_64, android-33 | Google APIs Intel x86 Atom_64
      Android NDK: Not Found
    Windows SDK: Not Found
  IDEs:
    Android Studio: AI-213.7172.25.2113.9014738
    Visual Studio: Not Found
  Languages:
    Java: 18.0.1.1
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0
    react-native: 0.71.3 => 0.71.3
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to Reproduce

I'm getting this issue when i' trying to update package
from
"@react-native-async-storage/async-storage": "~1.15.0",
to
"@react-native-async-storage/async-storage": "1.17.11",

@hkrvikrant hkrvikrant added the bug Something isn't working label Apr 6, 2023
@Aikron
Copy link

Aikron commented Apr 7, 2023

I'm facing the exact same issue on iOS. (I've replaced all imports on my project and it's still showing this error)
image

async-storage: 1.18.1

@NETCHANOK61
Copy link

Screenshot 2566-04-07 at 15 33 54

me too, please tell me to solve this problem @react-native-async-storage/async-storage: 1.17.11

@tido64
Copy link
Member

tido64 commented Apr 7, 2023

Hi folks, is this reproducible with a new project? I suspect what's happening is that one of your dependencies are still using AsyncStorage from react-native. That is why you're getting this error message.

@NETCHANOK61
Copy link

Hi folks, is this reproducible with a new project? I suspect what's happening is that one of your dependencies are still using AsyncStorage from react-native. That is why you're getting this error message.

I changed according to the error message but it still doesn't work.

@tido64
Copy link
Member

tido64 commented Apr 7, 2023

Hi folks, is this reproducible with a new project? I suspect what's happening is that one of your dependencies are still using AsyncStorage from react-native. That is why you're getting this error message.

I changed according to the error message but it still doesn't work.

Hi, what I'm trying to say is that you may have a dependency A that is still using the old AsyncStorage. Or maybe A depends on B and B is the culprit. It's not necessarily in your own code. The only way to check this is to look for occurrences of AsyncStorage inside your node_modules folder.

@NETCHANOK61
Copy link

Hi folks, is this reproducible with a new project? I suspect what's happening is that one of your dependencies are still using AsyncStorage from react-native. That is why you're getting this error message.

I changed according to the error message but it still doesn't work.

Hi, what I'm trying to say is that you may have a dependency A that is still using the old AsyncStorage. Or maybe A depends on B and B is the culprit. It's not necessarily in your own code. The only way to check this is to look for occurrences of AsyncStorage inside your node_modules folder.

What if I have multiple files in that folder? Can you suggest an easy way to check?

@tido64
Copy link
Member

tido64 commented Apr 7, 2023

What if I have multiple files in that folder? Can you suggest an easy way to check?

This depends on your workflow. If you're using VS Code, you can use the built-in search feature: https://code.visualstudio.com/docs/editor/codebasics#_search-across-files

If you're used to the terminal, you can use: grep -R AsyncStorage node_modules/*

@hkrvikrant
Copy link
Author

What if I have multiple files in that folder? Can you suggest an easy way to check?

This depends on your workflow. If you're using VS Code, you can use the built-in search feature: https://code.visualstudio.com/docs/editor/codebasics#_search-across-files

If you're used to the terminal, you can use: grep -R AsyncStorage node_modules/*

Not worked this one also

@MrLokeshKumar
Copy link

is there any update to support react native version 71, blocked to use async storage

@hkrvikrant
Copy link
Author

is there any update to support react native version 71, blocked to use async storage

Not yet bro

@kelset
Copy link

kelset commented Apr 27, 2023

@MrLokeshKumar @hkrvikrant if you checked the release notes, you'd know that RN71 is supported since 1.17.11 https://github.com/react-native-async-storage/async-storage/releases/tag/v1.17.11 and RN72 from 1.18.1 https://github.com/react-native-async-storage/async-storage/releases/tag/v1.18.1

@tido64 explained to you were the error comes from (and the error message itself did too), and it's related to you having still imports of the type:

import {AsyncStorage} from "react-native"

It's not an issue with the library, so this issue should be closed.

@tido64 tido64 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 27, 2023
@Durotemy
Copy link

i have installed the new dependency and also changed the import to the below, but i still encouter the same error

import AsyncStorage from '@react-native-async-storage/async-storage';

@JovanSr
Copy link

JovanSr commented Oct 5, 2023

I checked the node_modules for any occurence of "import {AsyncStorage} from "react-native" or "import { AsyncStorage } from "react-native" or "import AsyncStorage from "react-native".
There is nothing.

I still get an error event for the Async storage.
I upgraded my bare workflow project from SDK47 to SD48

@Herik22
Copy link

Herik22 commented Oct 10, 2023

@JovanSr Did you find any solution?

@Durotemy
Copy link

Durotemy commented Oct 11, 2023 via email

@SandeepJhaVC
Copy link

getting same issue even though I am not using AsyncStorage anywhere in my code.

@tido64
Copy link
Member

tido64 commented Oct 11, 2023

This issue occurs when something, it doesn't have to be your own code, is using AsyncStorage from React Native. It could be a dependency, or it could be a dependency of another dependency. There are a couple of things you can do to figure out where it's coming from:

  1. You can look for instances of AsyncStorage under your node_modules folder. Yes, that means checking ALL files. If you have several node_modules folders, you need to check ALL of them.
  2. The other option is to inspect your unminifed JS bundle. You will definitely find instance of AsyncStorage in there.

I am going to lock this conversation now because people keep coming in asking for a solution without reading the whole thread. To be perfectly clear, this is not a bug in AsyncStorage. It is a bug in your project.

@react-native-async-storage react-native-async-storage locked as resolved and limited conversation to collaborators Oct 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants