react-native-mmkv icon indicating copy to clipboard operation
react-native-mmkv copied to clipboard

3.0.1 iOS build issue with RN 0.75.2

Open divineniiquaye opened this issue 1 year ago • 1 comments

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.

divineniiquaye avatar Aug 28 '24 13:08 divineniiquaye

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.

maintenance-hans[bot] avatar Aug 28 '24 13:08 maintenance-hans[bot]

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

divineniiquaye avatar Aug 28 '24 17:08 divineniiquaye

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

mrousavy avatar Aug 29 '24 15:08 mrousavy

released in react-native-mmkv 3.0.2 :rocket:

mrousavy avatar Aug 29 '24 15:08 mrousavy

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

RajeshPandey057 avatar Aug 30 '24 14:08 RajeshPandey057

+1

amjadbouhouch avatar Aug 31 '24 11:08 amjadbouhouch

+1

cookiedev23 avatar Aug 31 '24 15:08 cookiedev23

  • 1

dannyilyas avatar Sep 01 '24 01:09 dannyilyas

-1

mrousavy avatar Sep 02 '24 09:09 mrousavy

-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

howljs avatar Sep 02 '24 10:09 howljs

+1

maukoese avatar Sep 03 '24 19:09 maukoese

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

still the same issue during the building process on IOS

MikhailR1337 avatar Sep 05 '24 04:09 MikhailR1337

+1

baronha avatar Sep 10 '24 14:09 baronha

+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

amutsch avatar Sep 10 '24 14:09 amutsch

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 avatar Sep 15 '24 11:09 batcodegen

@batcodegen Both links do not show any information.

adesugbaa avatar Sep 15 '24 14:09 adesugbaa

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

eyupk3 avatar Sep 22 '24 12:09 eyupk3

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

dembeEdward avatar Oct 05 '24 14:10 dembeEdward

"add new architecture" : nah "use this patch!": nah

Just use v2.12.2 and it works.

oscadev avatar Oct 15 '24 18:10 oscadev

"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

Screenshot 2024-10-16 at 11 14 46

mrousavy avatar Oct 16 '24 09:10 mrousavy

.

n0xgg04 avatar Feb 20 '25 07:02 n0xgg04