react-native-async-storage / async-storage

An asynchronous, persistent, key-value storage system for React Native.
https://react-native-async-storage.github.io/async-storage/
MIT License
4.62k stars 459 forks source link

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

Closed hkrvikrant closed 1 year ago

hkrvikrant commented 1 year ago

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?

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",

Aikron commented 1 year ago

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 commented 1 year ago
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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

hkrvikrant commented 1 year ago

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

Not yet bro

kelset commented 1 year ago

@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.

Durotemy commented 11 months ago

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 commented 9 months ago

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 commented 9 months ago

@JovanSr Did you find any solution?

Durotemy commented 9 months ago

Honestly, I didn't find any solution.

On Tue, Oct 10, 2023, 11:08 PM Herik Arismendy @.***> wrote:

@JovanSr https://github.com/JovanSr Did you find any solution?

— Reply to this email directly, view it on GitHub https://github.com/react-native-async-storage/async-storage/issues/955#issuecomment-1756336358, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVVBD3XEQXTH2YYN7DM43BLX6XBM3AVCNFSM6AAAAAAWU6L44KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJWGMZTMMZVHA . You are receiving this because you commented.Message ID: @.*** com>

SandeepJhaVC commented 9 months ago

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

tido64 commented 9 months ago

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.