3.0.1 iOS build issue with RN 0.75.2
I encountered this issue on my MacOS Sequoia 15.0 (Beta) with new architect enabled react native expo 51.0.31
Compiling react-native-mmkv Pods/react-native-mmkv » NativeMmkvModule.cpp
❌ (node_modules/react-native-mmkv/cpp/NativeMmkvModule.h:24:83)
22 | // The MMKVConfiguration type from JS
23 | using MMKVConfig = MmkvCxxConfiguration<std::string, std::optional<std::string>,
> 24 | std::optional<std::string>, std::optional<MmkvCxxMode>>;
| ^ use of undeclared identifier 'MmkvCxxMode'
25 | template <> struct Bridging<MMKVConfig> : MmkvCxxConfigurationBridging<MMKVConfig> {};
26 |
27 | // The TurboModule itself
❌ (node_modules/react-native-mmkv/cpp/NativeMmkvModule.h:25:29)
23 | using MMKVConfig = MmkvCxxConfiguration<std::string, std::optional<std::string>,
24 | std::optional<std::string>, std::optional<MmkvCxxMode>>;
> 25 | template <> struct Bridging<MMKVConfig> : MmkvCxxConfigurationBridging<MMKVConfig> {};
| ^ use of undeclared identifier 'MMKVConfig'
26 |
27 | // The TurboModule itself
28 | class NativeMmkvModule : public NativeMmkvCxxSpec<NativeMmkvModule> {
❌ (node_modules/react-native-mmkv/cpp/NativeMmkvModule.h:25:72)
23 | using MMKVConfig = MmkvCxxConfiguration<std::string, std::optional<std::string>,
24 | std::optional<std::string>, std::optional<MmkvCxxMode>>;
> 25 | template <> struct Bridging<MMKVConfig> : MmkvCxxConfigurationBridging<MMKVConfig> {};
| ^ use of undeclared identifier 'MMKVConfig'
26 |
27 | // The TurboModule itself
28 | class NativeMmkvModule : public NativeMmkvCxxSpec<NativeMmkvModule> {
❌ (node_modules/react-native-mmkv/cpp/NativeMmkvModule.h:34:49)
32 |
33 | bool initialize(jsi::Runtime& runtime, std::string basePath);
> 34 | jsi::Object createMMKV(jsi::Runtime& runtime, MMKVConfig config);
| ^ unknown type name 'MMKVConfig'
35 | };
36 |
37 | } // namespace facebook::react
❌ (node_modules/react-native-mmkv/cpp/MmkvHostObject.h:20:41)
18 | class MmkvHostObject : public jsi::HostObject {
19 | public:
> 20 | MmkvHostObject(const facebook::react::MMKVConfig& config);
| ^ no type named 'MMKVConfig' in namespace 'facebook::react'
21 | ~MmkvHostObject();
22 |
23 | public:
❌ (node_modules/react-native-mmkv/cpp/MmkvHostObject.h:28:54)
26 |
27 | private:
> 28 | static MMKVMode getMMKVMode(const facebook::react::MMKVConfig& config);
| ^ no type named 'MMKVConfig' in namespace 'facebook::react'
29 |
30 | private:
31 | MMKV* instance;
❌ (node_modules/react-native-mmkv/cpp/NativeMmkvModule.cpp:38:65)
36 | NativeMmkvModule::~NativeMmkvModule() {}
37 |
> 38 | jsi::Object NativeMmkvModule::createMMKV(jsi::Runtime& runtime, MMKVConfig config) {
| ^ unknown type name 'MMKVConfig'
39 | auto instance = std::make_shared<MmkvHostObject>(config);
40 | return jsi::Object::createFromHostObject(runtime, instance);
41 | }
› Compiling react-native-mmkv Pods/react-native-mmkv » MmkvPlatformContextModule.mm
› Compiling react-native-mmkv Pods/react-native-mmkv » MmkvOnLoad.mm
❌ (node_modules/react-native-mmkv/cpp/NativeMmkvModule.h:24:83)
22 | // The MMKVConfiguration type from JS
23 | using MMKVConfig = MmkvCxxConfiguration<std::string, std::optional<std::string>,
> 24 | std::optional<std::string>, std::optional<MmkvCxxMode>>;
| ^ use of undeclared identifier 'MmkvCxxMode'
25 | template <> struct Bridging<MMKVConfig> : MmkvCxxConfigurationBridging<MMKVConfig> {};
26 |
27 | // The TurboModule itself
❌ (node_modules/react-native-mmkv/cpp/NativeMmkvModule.h:25:29)
23 | using MMKVConfig = MmkvCxxConfiguration<std::string, std::optional<std::string>,
24 | std::optional<std::string>, std::optional<MmkvCxxMode>>;
> 25 | template <> struct Bridging<MMKVConfig> : MmkvCxxConfigurationBridging<MMKVConfig> {};
| ^ use of undeclared identifier 'MMKVConfig'
26 |
27 | // The TurboModule itself
28 | class NativeMmkvModule : public NativeMmkvCxxSpec<NativeMmkvModule> {
❌ (node_modules/react-native-mmkv/cpp/NativeMmkvModule.h:25:72)
23 | using MMKVConfig = MmkvCxxConfiguration<std::string, std::optional<std::string>,
24 | std::optional<std::string>, std::optional<MmkvCxxMode>>;
> 25 | template <> struct Bridging<MMKVConfig> : MmkvCxxConfigurationBridging<MMKVConfig> {};
| ^ use of undeclared identifier 'MMKVConfig'
26 |
27 | // The TurboModule itself
28 | class NativeMmkvModule : public NativeMmkvCxxSpec<NativeMmkvModule> {
❌ (node_modules/react-native-mmkv/cpp/NativeMmkvModule.h:34:49)
32 |
33 | bool initialize(jsi::Runtime& runtime, std::string basePath);
> 34 | jsi::Object createMMKV(jsi::Runtime& runtime, MMKVConfig config);
| ^ unknown type name 'MMKVConfig'
35 | };
36 |
37 | } // namespace facebook::react
› Compiling react-native-mmkv Pods/react-native-mmkv » MmkvHostObject.cpp
❌ (node_modules/react-native-mmkv/cpp/NativeMmkvModule.h:24:83)
22 | // The MMKVConfiguration type from JS
23 | using MMKVConfig = MmkvCxxConfiguration<std::string, std::optional<std::string>,
> 24 | std::optional<std::string>, std::optional<MmkvCxxMode>>;
| ^ use of undeclared identifier 'MmkvCxxMode'
25 | template <> struct Bridging<MMKVConfig> : MmkvCxxConfigurationBridging<MMKVConfig> {};
26 |
27 | // The TurboModule itself
❌ (node_modules/react-native-mmkv/cpp/NativeMmkvModule.h:25:29)
23 | using MMKVConfig = MmkvCxxConfiguration<std::string, std::optional<std::string>,
24 | std::optional<std::string>, std::optional<MmkvCxxMode>>;
> 25 | template <> struct Bridging<MMKVConfig> : MmkvCxxConfigurationBridging<MMKVConfig> {};
| ^ use of undeclared identifier 'MMKVConfig'
26 |
27 | // The TurboModule itself
28 | class NativeMmkvModule : public NativeMmkvCxxSpec<NativeMmkvModule> {
❌ (node_modules/react-native-mmkv/cpp/NativeMmkvModule.h:25:72)
23 | using MMKVConfig = MmkvCxxConfiguration<std::string, std::optional<std::string>,
24 | std::optional<std::string>, std::optional<MmkvCxxMode>>;
> 25 | template <> struct Bridging<MMKVConfig> : MmkvCxxConfigurationBridging<MMKVConfig> {};
| ^ use of undeclared identifier 'MMKVConfig'
26 |
27 | // The TurboModule itself
28 | class NativeMmkvModule : public NativeMmkvCxxSpec<NativeMmkvModule> {
❌ (node_modules/react-native-mmkv/cpp/NativeMmkvModule.h:34:49)
32 |
33 | bool initialize(jsi::Runtime& runtime, std::string basePath);
> 34 | jsi::Object createMMKV(jsi::Runtime& runtime, MMKVConfig config);
| ^ unknown type name 'MMKVConfig'
35 | };
36 |
37 | } // namespace facebook::react
❌ (node_modules/react-native-mmkv/cpp/MmkvHostObject.h:20:41)
18 | class MmkvHostObject : public jsi::HostObject {
19 | public:
> 20 | MmkvHostObject(const facebook::react::MMKVConfig& config);
| ^ no type named 'MMKVConfig' in namespace 'facebook::react'
21 | ~MmkvHostObject();
22 |
23 | public:
❌ (node_modules/react-native-mmkv/cpp/MmkvHostObject.h:28:54)
26 |
27 | private:
> 28 | static MMKVMode getMMKVMode(const facebook::react::MMKVConfig& config);
| ^ no type named 'MMKVConfig' in namespace 'facebook::react'
29 |
30 | private:
31 | MMKV* instance;
› Compiling react-native-mmkv Pods/react-native-mmkv » MiniPBCoder_OSX.cpp
› Compiling react-native-mmkv Pods/react-native-mmkv » MiniPBCoder.cpp
› Compiling react-native-mmkv Pods/react-native-mmkv » MemoryFile_Win32.cpp
› Compiling react-native-mmkv Pods/react-native-mmkv » MemoryFile_OSX.cpp
› Compiling react-native-mmkv Pods/react-native-mmkv » MemoryFile_Linux.cpp
› Compiling react-native-mmkv Pods/react-native-mmkv » MemoryFile_Android.cpp
› Compiling react-native-mmkv Pods/react-native-mmkv » MemoryFile.cpp
⚠️ Script has ambiguous dependencies causing it to run on every build.
To fix, go to: Xcode » MyApp/MyApp » Build Phases » 'Upload Debug Symbols to Sentry'
Either: Uncheck "Based on dependency analysis", or select output files to trigger the script
⚠️ Script has ambiguous dependencies causing it to run on every build.
To fix, go to: Xcode » MyApp/MyApp » Build Phases » '[CP-User] [RNFB] Core Configuration'
Either: Uncheck "Based on dependency analysis", or select output files to trigger the script
⚠️ Script has ambiguous dependencies causing it to run on every build.
To fix, go to: Xcode » MyApp/MyApp » Build Phases » '[CP-User] [RNFB] Crashlytics Configuration'
Either: Uncheck "Based on dependency analysis", or select output files to trigger the script
› 17 error(s), and 3 warning(s)
CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Guten Tag, Hans here! 🥨🍻
Thanks for reporting ze issue. It looks like you have a compilation problem related to MMKVConfig and MmkvCxxMode. However, I see that you are using a beta version of macOS and a new architect of React Native, which could lead to compatibility issues.
Could you please provide more details about your setup? Specifically, we need to know the versions of React Native and other libraries you are using, as well as output from the Xcode build logs showing any additional context on ze errors. This information can help mrousavy track down ze issue more effectively.
If you're finding this repository useful, consider sponsoring mrousavy to help keep ze project alive: Sponsor mrousavy.
Note: If you think I made a mistake, please ping
@mrousavyto take a look.
I was able to resolve the issue by using the patch Originally posted by @davebray131 in https://github.com/mrousavy/react-native-mmkv/issues/718#issuecomment-2295330525.
Just rename the patch file to react-native-mmkv+3.0.1.patch
This is a duplicate of
- https://github.com/mrousavy/react-native-mmkv/issues/725
- https://github.com/mrousavy/react-native-mmkv/issues/722
- and https://github.com/mrousavy/react-native-mmkv/issues/718
They were all visible in the issues page, please don't spam issues or create duplicates. We already have enough of them.
I am working on a fix and will release it soon - in the meantime you can sponsor me on GitHub to buy me a coffee or say "thanks". 😃❤️
released in react-native-mmkv 3.0.2 :rocket:
Still facing the same issue. With version 3.0.1 and 3.0.2 both
+1
+1
- 1
-1
-1
Everything is working fine. Just make sure that react-native is on version 0.75.x. I used the new architecture on version 0.74 but it didn’t work, so I had to upgrade to 0.75
+1
react-native: "0.75.2" expo: "51.0.32" mmkv: "3.0.2"
still the same issue during the building process on IOS
+1
+1 with 0 details helps no one, See here where I outline a number of things about the combination of libs and migrating between versions https://github.com/mrousavy/react-native-mmkv/issues/731#issuecomment-2339487315
for me updating my mac and xcode to latest update fixed the issue automatically. Also had to follow the steps https://github.com/reactwg/react-native-new-architecture/blob/main/docs/enable-apps.md specifically https://github.com/reactwg/react-native-new-architecture/blob/main/docs/enable-apps.md#troubleshooting
@batcodegen Both links do not show any information.
❌ (node_modules/react-native-mmkv/cpp/NativeMmkvModule.h:25:43)
"expo": "~51.0.28", "react": "18.2.0", "react-dom": "18.2.0", "react-native-mmkv": "^3.0.2",
I was also facing the same issue with my iOS build and after having a look at NativeMmkvModule.h I noticed some definitions missing. I updated the file and the build worked fine. Here is the patch file
react-native-mmkv+3.0.2.patch
"add new architecture" : nah "use this patch!": nah
Just use v2.12.2 and it works.
"add new architecture" : nah "use this patch!": nah
Just use v2.12.2 and it works.
well yea thats what the README says at the top
.