Code Monkey home page Code Monkey logo

Comments (8)

mrousavy avatar mrousavy commented on May 19, 2024 2

I just released MMKV v1.2.0 which includes a fix for this, let me know if it worked!

from react-native-mmkv.

ahanusek avatar ahanusek commented on May 19, 2024

The same for few users with iOS 14.6.0:

iOS: 14.6.0 (18F72)
Phone: iPhone 11 Pro Max, iPhone 7, iPhone 7 Plus

Fatal Exception: RCTFatalException: Unhandled JS Exception: TypeError: r(d[6]).MMKV.getBoolean is not a function. (In 'r(d[6]).MMKV.getBoolean('onboarded')', 'r(d[6]).MMKV.getBoolean' is undefined)
0 CoreFoundation 0x190962754 _exceptionPreprocess
1 libobjc.A.dylib 0x1a54297a8 objc_exception_throw
2 mobile 0x102996470 RCTFormatError + 166 (RCTAssert.m:166)
3 mobile 0x102a14cf4 -[RCTExceptionsManager reportFatal:stack:exceptionId:suppressRedBox:] + 89 (RCTExceptionsManager.mm:89)
4 mobile 0x102a156b8 -[RCTExceptionsManager reportException:] + 164 (RCTExceptionsManager.mm:164)
5 CoreFoundation 0x190967774 invoking

6 CoreFoundation 0x19083ad44 -[NSInvocation invoke]
7 CoreFoundation 0x19083b348 -[NSInvocation invokeWithTarget:]
8 mobile 0x1029c78a4 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 587 (RCTModuleMethod.mm:587)
9 mobile 0x1029c9cd4 facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&, int, (anonymous namespace)::SchedulingContext) + 181 (RCTNativeModule.mm:181)
10 mobile 0x1029c9900 invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) + 404 (Optional.h:404)
11 libdispatch.dylib 0x19054da84 _dispatch_call_block_and_release
12 libdispatch.dylib 0x19054f81c _dispatch_client_callout
13 libdispatch.dylib 0x190557004 _dispatch_lane_serial_drain
14 libdispatch.dylib 0x190557c00 _dispatch_lane_invoke
15 libdispatch.dylib 0x1905624bc _dispatch_workloop_worker_thread
16 libsystem_pthread.dylib 0x1dc4c67a4 _pthread_wqthread
17 libsystem_pthread.dylib 0x1dc4cd74c start_wqthread

from react-native-mmkv.

mrousavy avatar mrousavy commented on May 19, 2024

Looks like a race condition. I'll try to find a way to fix this without requiring any changes from the user

from react-native-mmkv.

franck-nadeau avatar franck-nadeau commented on May 19, 2024

The same is happening to us on react-native 0.62.2.

Are there any work around?

from react-native-mmkv.

roncodes avatar roncodes commented on May 19, 2024

Running into this issue on ios simulator currently on RN 0.64.2

In my case MMKV is imported but all the methods are undefined.

Screenshot 2021-07-08 at 9 50 51 AM

from react-native-mmkv.

roncodes avatar roncodes commented on May 19, 2024

I've upgraded to 1.2.0 also updated in pods via npx pod-install but still getting all methods of MMKV as undefined.

This is what my xcode logs are saying regarding MMKV:

From iPhone 12 device:

2021-07-09 14:17:50.117824+0800 StorefrontApp[73533:4682756] [I] <MMKV.cpp:156::initialize> version v1.2.10, page size 16384, arch arm64-v8a
2021-07-09 14:17:50.117898+0800 StorefrontApp[73533:4682756] [I] <AESCrypt.cpp:247::testAESCrypt> AES CFB decode: Hello, OpenSSL-mmkv::AESCrypt::testAESCrypt() with AES CFB 128.
2021-07-09 14:17:50.117970+0800 StorefrontApp[73533:4682756] [I] <KeyValueHolder.cpp:224::testAESToMMBuffer> testAESToMMBuffer: Hello, OpenSSL-mmkv::KeyValueHolderCrypt::testAESToMMBuffer() with AES CFB 128.
2021-07-09 14:17:50.117994+0800 StorefrontApp[73533:4682756] [I] <KeyValueHolder.cpp:229::testAESToMMBuffer> MMBuffer::SmallBufferSize() = 24, KeyValueHolderCrypt::SmallBufferSize() = 27
2021-07-09 14:17:50.118040+0800 StorefrontApp[73533:4682756] [I] <MMKV_OSX.cpp:100::minimalInit> Apple Device:3, version:13
2021-07-09 14:17:50.118264+0800 StorefrontApp[73533:4682756] [I] <MMKV_OSX.cpp:105::minimalInit> default root dir: /var/mobile/Containers/Data/Application/3F877C5C-6A9F-4509-A6EE-D56C9DFF1E23/Documents/mmkv
2021-07-09 14:17:50.118307+0800 StorefrontApp[73533:4682756] [I] <MMKV_OSX.cpp:116::setIsInBackground> g_isInBackground:0
2021-07-09 14:17:50.118333+0800 StorefrontApp[73533:4682756] [I] <libMMKV.mm:80::+[MMKV initialize]> appState:0
2021-07-09 14:17:50.118500+0800 StorefrontApp[73533:4682756] [I] <MMKV.cpp:198::initializeMMKV> root dir: /var/mobile/Containers/Data/Application/3F877C5C-6A9F-4509-A6EE-D56C9DFF1E23/Documents/mmkv
2021-07-09 14:17:50.118815+0800 StorefrontApp[73533:4682756] [W] <libMMKV.mm:97::+[MMKV initializeMMKV:logLevel:]> already called +initializeMMKV before, ignore this request
2021-07-09 14:17:50.120342+0800 StorefrontApp[73533:4682756] [I] <MemoryFile_OSX.cpp:36::tryResetFileProtection> protection on [/var/mobile/Containers/Data/Application/3F877C5C-6A9F-4509-A6EE-D56C9DFF1E23/Documents/mmkv/mmkvIdStore] is NSFileProtectionCompleteUntilFirstUserAuthentication
2021-07-09 14:17:50.120805+0800 StorefrontApp[73533:4682756] [I] <MemoryFile_OSX.cpp:36::tryResetFileProtection> protection on [/var/mobile/Containers/Data/Application/3F877C5C-6A9F-4509-A6EE-D56C9DFF1E23/Documents/mmkv/mmkvIdStore.crc] is NSFileProtectionCompleteUntilFirstUserAuthentication
2021-07-09 14:17:50.120881+0800 StorefrontApp[73533:4682756] [I] <MMKV_IO.cpp:81::loadFromFile> loading [mmkvIdStore] with 0 actual size, file size 16384, InterProcess 0, meta info version:0
2021-07-09 14:17:50.121115+0800 StorefrontApp[73533:4682756] [I] <MMKV_IO.cpp:130::loadFromFile> loaded [mmkvIdStore] with 0 key-values
2021-07-09 14:17:50.121235+0800 StorefrontApp[73533:4682968] [connection] nw_endpoint_handler_set_adaptive_read_handler [C3 192.168.1.162:8081 ready socket-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for read_timeout failed
2021-07-09 14:17:50.121267+0800 StorefrontApp[73533:4682968] [connection] nw_endpoint_handler_set_adaptive_write_handler [C3 192.168.1.162:8081 ready socket-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for write_timeout failed
2021-07-09 14:17:50.125444+0800 StorefrontApp[73533:4682756] [native] Invalidating <RCTCxxBridge: 0x1062115d0> (parent: <RCTBridge: 0x283103d40>, executor: RCTWebSocketExecutor)
2021-07-09 14:17:50.126269+0800 StorefrontApp[73533:4682985] [I] <MemoryFile_OSX.cpp:36::tryResetFileProtection> protection on [/var/mobile/Containers/Data/Application/3F877C5C-6A9F-4509-A6EE-D56C9DFF1E23/Documents/mmkv/mmkv.default] is NSFileProtectionCompleteUntilFirstUserAuthentication
2021-07-09 14:17:50.126771+0800 StorefrontApp[73533:4682985] [I] <MemoryFile_OSX.cpp:36::tryResetFileProtection> protection on [/var/mobile/Containers/Data/Application/3F877C5C-6A9F-4509-A6EE-D56C9DFF1E23/Documents/mmkv/mmkv.default.crc] is NSFileProtectionCompleteUntilFirstUserAuthentication
2021-07-09 14:17:50.126809+0800 StorefrontApp[73533:4682985] [I] <MMKV_IO.cpp:81::loadFromFile> loading [mmkv.default] with 0 actual size, file size 16384, InterProcess 0, meta info version:0
2021-07-09 14:17:50.126832+0800 StorefrontApp[73533:4682985] [I] <MMKV_IO.cpp:130::loadFromFile> loaded [mmkv.default] with 0 key-values
2021-07-09 14:17:50.126860+0800 StorefrontApp[73533:4682985] [I] <libMMKV.mm:282::-[MMKV close]> closing mmkv.default
2021-07-09 14:17:50.126879+0800 StorefrontApp[73533:4682985] [I] <MMKV.cpp:276::clearMemoryCache> clearMemoryCache [mmkv.default]
2021-07-09 14:17:50.127004+0800 StorefrontApp[73533:4682985] [I] <libMMKV.mm:235::-[MMKV dealloc]> dealloc mmkv.default
2021-07-09 14:17:50.127026+0800 StorefrontApp[73533:4682985] [I] <MMKV.cpp:301::close> close [mmkv.default]
2021-07-09 14:17:50.127083+0800 StorefrontApp[73533:4682985] [I] <MMKV.cpp:139::~MMKV> destruct [mmkv.default]

From iPhone 12 Simulator:

2021-07-09 14:01:33.848968+0800 StorefrontApp[54047:2316032] [I] <MMKV_OSX.cpp:105::minimalInit> default root dir: /.../Library/Developer/CoreSimulator/Devices/5FB14FE5-00B3-4A26-BD7A-A71D424A53F4/data/Containers/Data/Application/191FA4CF-4780-4D6F-BA77-5F7AB189C2A1/Documents/mmkv
2021-07-09 14:01:33.849632+0800 StorefrontApp[54047:2316032] [I] <MMKV_OSX.cpp:116::setIsInBackground> g_isInBackground:0
2021-07-09 14:01:33.849936+0800 StorefrontApp[54047:2316032] [I] <libMMKV.mm:80::+[MMKV initialize]> appState:0
2021-07-09 14:01:33.850552+0800 StorefrontApp[54047:2316032] [I] <MMKV.cpp:198::initializeMMKV> root dir: /.../Library/Developer/CoreSimulator/Devices/5FB14FE5-00B3-4A26-BD7A-A71D424A53F4/data/Containers/Data/Application/191FA4CF-4780-4D6F-BA77-5F7AB189C2A1/Documents/mmkv
2021-07-09 14:01:33.859055+0800 StorefrontApp[54047:2316032] [W] <libMMKV.mm:97::+[MMKV initializeMMKV:logLevel:]> already called +initializeMMKV before, ignore this request
2021-07-09 14:01:33.895166+0800 StorefrontApp[54047:2316032] [I] <MemoryFile_OSX.cpp:36::tryResetFileProtection> protection on [/.../Library/Developer/CoreSimulator/Devices/5FB14FE5-00B3-4A26-BD7A-A71D424A53F4/data/Containers/Data/Application/191FA4CF-4780-4D6F-BA77-5F7AB189C2A1/Documents/mmkv/mmkvIdStore] is (null)
2021-07-09 14:01:33.903092+0800 StorefrontApp[54047:2316032] [I] <MemoryFile_OSX.cpp:36::tryResetFileProtection> protection on [/.../Library/Developer/CoreSimulator/Devices/5FB14FE5-00B3-4A26-BD7A-A71D424A53F4/data/Containers/Data/Application/191FA4CF-4780-4D6F-BA77-5F7AB189C2A1/Documents/mmkv/mmkvIdStore.crc] is (null)
2021-07-09 14:01:33.915056+0800 StorefrontApp[54047:2316032] [I] <MMKV_IO.cpp:81::loadFromFile> loading [mmkvIdStore] with 0 actual size, file size 4096, InterProcess 0, meta info version:1
2021-07-09 14:01:33.915656+0800 StorefrontApp[54047:2316032] [I] <MMKV_IO.cpp:130::loadFromFile> loaded [mmkvIdStore] with 0 key-values
2021-07-09 14:01:33.935976+0800 StorefrontApp[54047:2316032] [native] Invalidating <RCTCxxBridge: 0x7fdbf260afe0> (parent: <RCTBridge: 0x600000b40a10>, executor: RCTWebSocketExecutor)
2021-07-09 14:01:33.970027+0800 StorefrontApp[54047:2316644] [I] <MemoryFile_OSX.cpp:36::tryResetFileProtection> protection on [/.../Library/Developer/CoreSimulator/Devices/5FB14FE5-00B3-4A26-BD7A-A71D424A53F4/data/Containers/Data/Application/191FA4CF-4780-4D6F-BA77-5F7AB189C2A1/Documents/mmkv/mmkv.default] is (null)
2021-07-09 14:01:33.971598+0800 StorefrontApp[54047:2316644] [I] <MemoryFile_OSX.cpp:36::tryResetFileProtection> protection on [/.../Library/Developer/CoreSimulator/Devices/5FB14FE5-00B3-4A26-BD7A-A71D424A53F4/data/Containers/Data/Application/191FA4CF-4780-4D6F-BA77-5F7AB189C2A1/Documents/mmkv/mmkv.default.crc] is (null)
2021-07-09 14:01:33.978801+0800 StorefrontApp[54047:2316644] [I] <MMKV_IO.cpp:81::loadFromFile> loading [mmkv.default] with 0 actual size, file size 4096, InterProcess 0, meta info version:1
2021-07-09 14:01:33.979450+0800 StorefrontApp[54047:2316644] [I] <MMKV_IO.cpp:130::loadFromFile> loaded [mmkv.default] with 0 key-values
2021-07-09 14:01:33.980430+0800 StorefrontApp[54047:2316644] [I] <libMMKV.mm:282::-[MMKV close]> closing mmkv.default
2021-07-09 14:01:33.980847+0800 StorefrontApp[54047:2316644] [I] <MMKV.cpp:276::clearMemoryCache> clearMemoryCache [mmkv.default]
2021-07-09 14:01:33.983675+0800 StorefrontApp[54047:2316644] [I] <libMMKV.mm:235::-[MMKV dealloc]> dealloc mmkv.default
2021-07-09 14:01:33.984112+0800 StorefrontApp[54047:2316644] [I] <MMKV.cpp:301::close> close [mmkv.default]
2021-07-09 14:01:33.986622+0800 StorefrontApp[54047:2316644] [I] <MMKV.cpp:139::~MMKV> destruct [mmkv.default]
2021-07-09 14:01:34.441071+0800 StorefrontApp[54047:2316866] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x6000021fc320> F8BB1C28-BAE8-11D6-9C31-00039315CD46

from react-native-mmkv.

mrousavy avatar mrousavy commented on May 19, 2024

@roncodes In your log it says RCTWebSocketExecutor - are you using a web debugger such as Google Chrome? JSI does not support remote debugging. Either disable the debugger or use Flipper/Safari to debug

from react-native-mmkv.

roncodes avatar roncodes commented on May 19, 2024

Ok my bad, that was it. ๐Ÿคฆ๐Ÿพโ€โ™‚๏ธ Thanks ๐Ÿ‘๐Ÿพ

from react-native-mmkv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.