mrousavy / react-native-mmkv

⚡️ The fastest key/value storage for React Native. ~30x faster than AsyncStorage!
https://mrousavy.com
MIT License
5.91k stars 254 forks source link

3.0.1 iOS build issue with RN 0.75.2 #726

Closed divineniiquaye closed 1 month ago

divineniiquaye commented 1 month ago

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.
maintenance-hans[bot] commented 1 month ago

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 @mrousavy to take a look.

divineniiquaye commented 1 month ago

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

mrousavy commented 1 month ago

This is a duplicate of

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". 😃❤️

mrousavy commented 1 month ago

released in react-native-mmkv 3.0.2 :rocket:

RajeshPandey057 commented 1 month ago

Still facing the same issue. With version 3.0.1 and 3.0.2 both

amjadbouhouch commented 4 weeks ago

+1

cookiedev23 commented 4 weeks ago

+1

dannyilyas commented 4 weeks ago
mrousavy commented 3 weeks ago

-1

howljs commented 3 weeks ago

-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

maukoese commented 3 weeks ago

+1

MikhailR1337 commented 3 weeks ago

react-native: "0.75.2" expo: "51.0.32" mmkv: "3.0.2"

still the same issue during the building process on IOS

baronha commented 2 weeks ago

+1

amutsch commented 2 weeks ago

+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

batcodegen commented 2 weeks ago

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

adesugbaa commented 2 weeks ago

@batcodegen Both links do not show any information.

eyupkoc29 commented 1 week ago

❌ (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",