Comments (8)
I just released MMKV v1.2.0 which includes a fix for this, let me know if it worked!
from react-native-mmkv.
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.
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.
The same is happening to us on react-native 0.62.2.
Are there any work around?
from react-native-mmkv.
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.
from react-native-mmkv.
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.
@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.
Ok my bad, that was it. ๐คฆ๐พโโ๏ธ Thanks ๐๐พ
from react-native-mmkv.
Related Issues (20)
- React-Native Android build is failing with error - Task :react-native-mmkv:prepareBoost FAILED HOT 14
- Naming events
- 'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead. HOT 3
- Read main application's mmkv values from Notification Service (IOS) HOT 7
- app groups: value undefined until restart HOT 4
- having problems with npx pod-install
- react-native-mmkv and encryption export regulations
- App group enhancement introduced a breaking change (2.10.0) HOT 2
- A lot of logs even in production builds HOT 8
- Make `Set` and `Get` method consistent HOT 6
- Error: react-native-mmkv is not supported in Expo Go! Use EAS HOT 5
- com.facebook.react.JavaScript (17): EXC_BAD_ACCESS (code=1, address=0xcf9b17) from bytes[m_position++]; HOT 2
- EXC_BAD_ACCESS on IOS with codepush restart
- detox throws error when metro is run with mocks HOT 2
- mmkv๊ด๋ จ ๋ก๊ทธ ๋ฐ์ ํด๊ฒฐ
- iOS crash: malloc: *** error for object 0x282611260: pointer being freed was not allocated EXC_CRASH (SIGABRT)
- Crash reports after switching to use AppGroups due to 0xdead10cc HOT 2
- Cannot run in react-native 0.73.x HOT 1
- use expo go ,start with this error: CommandError: No development build (com.anonymous.***) for this project is installed. Please make and install a development build on the device first. HOT 3
- Unable to resolve module ./createMMKV.mock HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-mmkv.