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

React native Asyncstorage issues #1169

Open
1 of 5 tasks
keshav00001 opened this issue Dec 9, 2024 · 3 comments
Open
1 of 5 tasks

React native Asyncstorage issues #1169

keshav00001 opened this issue Dec 9, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@keshav00001
Copy link

What happened?

UserListScreen.js:18 Warning: Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.

To fix this issue try these steps:

• Uninstall, rebuild and restart the app.

• Run the packager with --reset-cache flag.

• If you are using CocoaPods on iOS, run pod install in the ios directory, then rebuild and re-run the app.

• Make sure your project's package.json depends on @react-native-async-storage/async-storage, even if you only depend on it indirectly through other dependencies. CLI only autolinks native modules found in your package.json.

Version

@react-native-async-storage/async-storage": "^2.1.0"

What platforms are you seeing this issue on?

  • Android
  • iOS
  • macOS
  • Windows
  • web

System Information

System:
  OS: Windows 10 10.0.19045
  CPU: (4) x64 Intel(R) Core(TM) i3-7020U CPU @ 2.30GHz
  Memory: 1.67 GB / 7.85 GB
Binaries:
  Node:
    version: 22.11.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn: Not Found
  npm:
    version: 10.9.0
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: AI-242.23339.11.2421.12550806
  Visual Studio: Not Found
Languages:
  Java: 17.0.13
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.4
    wanted: 0.76.4
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
...............................................

"dependencies": {
    "@react-native-async-storage/async-storage": "^2.1.0",
    "@react-navigation/native": "^7.0.13",
    "@react-navigation/native-stack": "^7.1.14",
    "axios": "^1.7.9",
    "react": "18.3.1",
    "react-native": "0.76.4",
    "react-native-safe-area-context": "^5.0.0",
    "react-native-screens": "^4.3.0"
  },

..........................................

buildscript {
    ext {
        buildToolsVersion = "35.0.0"
        minSdkVersion = 24
        compileSdkVersion = 35
        targetSdkVersion = 34
        ndkVersion = "26.1.10909125"
        kotlinVersion = "1.9.24"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
    }
}

Steps to Reproduce

image

  1. --reset-cache

    grdlew clean,

    again install @react-native-async-storage/async-storage
    but same issue

  2. chart gpt suggestion add, but same issue facing last 4 days.

import com.reactnativecommunity.asyncstorage.AsyncStoragePackage

class MainApplication : Application(), ReactApplication {
override fun getPackages(): List {
return PackageList(this).packages + listOf(
AsyncStoragePackage() // Ensure this is included in your package list if you use an older version of React Native.
)
}
}

@keshav00001 keshav00001 added the bug Something isn't working label Dec 9, 2024
@sniperosx
Copy link

I also encountered the same problem here after upgrading to 0.76.5. I have already moved the project from MMKV to “vanilla” AysncStorage and basically end up with the same result.

Do we have individual project setup problems?

@nil-kombee
Copy link

Having the same problem

@aiengrimran
Copy link

In my case, it is working on iOS simulators, but I am having issues with Android. I am waiting for assistance. Can anyone please guide me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants