ammarahm-ed / react-native-mmkv-storage

An ultra fast (0.0002s read/write), small & encrypted mobile key-value storage framework for React Native written in C++ using JSI
https://rnmmkv.now.sh
MIT License
1.58k stars 109 forks source link

[Bug] MMKVNative Bindings Not Installed #356

Open MrMicrowaveOven opened 3 weeks ago

MrMicrowaveOven commented 3 weeks ago

Describe the bug These two lines alone are causing an error:

import { MMKVLoader, useMMKVStorage } from 'react-native-mmkv-storage';
const storage = new MMKVLoader().initialize();

To Reproduce Dependencies:

"react": "18.3.1",
"react-native": "0.75.2",

Expected behavior I have used this library in a previous app without issue.

Screenshots

Screenshot 2024-08-20 at 10 14 13 PM

Platform Information:

"dependencies": {
    "react": "18.3.1",
    "react-native": "0.75.2",
    "react-native-dropdown-picker": "^5.4.6",
    "react-native-mmkv-storage": "^0.10.2"
  }

Used on an Android emulator

ferdiu commented 3 weeks ago

I am affected by this too. It happened after I tried to upgrade react-native from version 0.74.3 to 0.75.2. Tried with both 0.9.1 and 0.10.2 versions of react-native-mmkv-storage package.

Probably related to #353.

MrMicrowaveOven commented 3 weeks ago

I am affected by this too. It happened after I tried to upgrade react-native from version 0.74.3 to 0.75.2. Tried with both 0.9.1 and 0.10.2 versions of react-native-mmkv-storage package.

Probably related to #353.

Oh wow. Yeah, I legit tried reverting to version 0.9.1 to fix it. Guess it's my react native version that messed it up. Not sure if I'm down to downgrade my react native version to make this work.

ammarahm-ed commented 3 weeks ago

Hi, can you try v0.10.3? Also do you have new arch enabled or disabled?

dppo commented 3 weeks ago

Hi, can you try v0.10.3? Also do you have new arch enabled or disabled?

Had the same problem on Android,react-native 0.75.2 and new arch enabled

MrMicrowaveOven commented 3 weeks ago

@ammarahm-ed Holy cow, switching to v0.10.3 fixed it!

Not familiar with new arch, but I'm guessing you're referring to this line:

# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false

Now that it works, I'm not going to mess with newArch. Should it be on though?

i-void commented 1 week ago

I'm also getting this error on my mobile phone with expo development (It works with emulator).
"react-native": "0.74.5", "react-native-mmkv-storage": "^0.9.1", (and 0.10.3) both doesn't work.