Skip to content

Conversation

cortinico
Copy link
Member

cc @mrousavy for visibility

@cortinico cortinico requested a review from Simek September 4, 2025 13:21
@mrousavy
Copy link
Member

mrousavy commented Sep 4, 2025

Looks great thanks!
Let's hope that builds lol

@cortinico
Copy link
Member Author

@mrousavy nope the beta fails on both Android & iOS for different reasons.

iOS

The Swift pod `NitroMmkv` depends upon `MMKVCore`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

Android

C/C++: /tmp/RNApp/node_modules/react-native-mmkv/android/CMakeLists.txt debug|armeabi-v7a : com.google.prefab.api.NoMatchingLibraryException: No compatible library found for //mmkv/mmkv. Rejected the following libraries:

Specifically are you prebuilding anything here? This seems like could be the reason of the failure.

@cortinico cortinico marked this pull request as draft September 4, 2025 13:34
@mrousavy
Copy link
Member

mrousavy commented Sep 4, 2025

Ah, shit. Both are expected.

  • iOS: MMKVCore currently does not define a module. I fixed it in fix: Make MMKV and MMKVCore define modules Tencent/MMKV#1579, once @lingol releases a new update of MMKVCore that'll be fixed.
  • Android: MMKVCore does not support 32-bit anymore. React Native still tries to build for 32-bit architectures (see reactNativeArchitectures in gradle.properties), so it fails to find the Prefab for that. In react-native-mmkv I tell users to remove the 32-bit from their gradle.properties file, but it's not ideal. Honestly I don't know what to do about that - do you have any ideas? In one of our apps we noticed only 0.5% of users still use 32-bit.

@cortinico
Copy link
Member Author

  • Honestly I don't know what to do about that - do you have any ideas? In one of our apps we noticed only 0.5% of users still use 32-bit.

mmm that's not ideal. Why can't you support 32-bit? I would like to brainstorm more about it as we'd like to avoid this becoming a 'trend'.

@mrousavy
Copy link
Member

mrousavy commented Sep 4, 2025

Why can't you support 32-bit? I would like to brainstorm more about it as we'd like to avoid this becoming a 'trend'.

MMKVCore doesn't support 32-bit anymore - at least since their v2 release. See their docs: MMKV for Android:

Starting from v2.0.0, MMKV no longer supports 32-bit arch and API level 22 or 21, if you want 32-bit or API level 21~22, use v1.3.x LTS series.

So I don't really know how else to get around this problem - I could try to make it build and then make it crash at Runtime - but I think that's a worse solution than just not making it build, I guess...

@cortinico
Copy link
Member Author

Why can't you support 32-bit? I would like to brainstorm more about it as we'd like to avoid this becoming a 'trend'.

MMKVCore doesn't support 32-bit anymore - at least since their v2 release. See their docs: MMKV for Android:

Starting from v2.0.0, MMKV no longer supports 32-bit arch and API level 22 or 21, if you want 32-bit or API level 21~22, use v1.3.x LTS series.

So I don't really know how else to get around this problem - I could try to make it build and then make it crash at Runtime - but I think that's a worse solution than just not making it build, I guess...

Yeah fair point. I've asked it here Tencent/MMKV#1580
We can unblock this by going with the /patches folder solution we discussed here: #17 (comment) and have react-native-mmkv set reactNativeArchitectures=arm64-v8a,x86_64 in the gradle.properties file.

@leoboyerbx
Copy link

leoboyerbx commented Sep 4, 2025

@cortinico as stated in the V4 Upgrade guide, the iOS build can be fixed by adding this to the Podfile:

pod 'MMKVCore', :modular_headers => true

If needed, we can make an expo config plugin that does this for Expo projects with CNG. I am willing to do this if needed.

This would be necessary only of the MMKV upstream release takes too long.

@leoboyerbx
Copy link

Yeah fair point. I've asked it here Tencent/MMKV#1580
We can unblock this by going with the /patches folder solution we discussed here: #17 (comment) and have react-native-mmkv set reactNativeArchitectures=arm64-v8a,x86_64 in the gradle.properties file.

It seems that even with that, the Android build does still crash: react-native-mmkv:#881. I don't have a good enough understanding of the Android build process to fix this, but at least the issue includes a repro.

@mrousavy
Copy link
Member

mrousavy commented Sep 6, 2025

We can unblock this by going with the /patches folder solution we discussed here: #17 (comment) and have react-native-mmkv set reactNativeArchitectures=arm64-v8a,x86_64 in the gradle.properties file.

Cool - sounds good to me. I will try to figure this out going forward then - maybe we can somehow get one build for MMKVCore V2 that still has 32-bit and stay on that for a while.

@Vishal-D4
Copy link

Vishal-D4 commented Sep 15, 2025

image

Getting the error given in the image while building iOS build in Xcode However for android it is working fine, Last week it was working fine but now don't know what's wrong with it.
react-native-version-: 0.76.6
react-native-nitro-modules-: 4.0.0-beta.9
nitrogen-: 0.29.4

@mrousavy
Copy link
Member

@Vishal-D4 this is off-topic. But this PR should fix your issue: mrousavy/react-native-mmkv#891

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants