Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0.1 iOS build issue with RN 0.75.2 #726

Closed
divineniiquaye opened this issue Aug 28, 2024 · 16 comments · Fixed by #729
Closed

3.0.1 iOS build issue with RN 0.75.2 #726

divineniiquaye opened this issue Aug 28, 2024 · 16 comments · Fixed by #729

Comments

@divineniiquaye
Copy link

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 maintenance-hans bot changed the title 3.0.1 iOS build issue with RN 0.75.2 3.0.1 iOS build issue with RN 0.75.2 Aug 28, 2024
Copy link

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
Copy link
Author

divineniiquaye commented Aug 28, 2024

I was able to resolve the issue by using the patch Originally posted by @davebray131 in #718 (comment).

Just rename the patch file to react-native-mmkv+3.0.1.patch

@mrousavy
Copy link
Owner

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
Copy link
Owner

released in react-native-mmkv 3.0.2 🚀

@RajeshPandey057
Copy link

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

@amjadbouhouch
Copy link

+1

1 similar comment
@cookiedev23
Copy link

+1

@dannyilyas
Copy link

  • 1

@mrousavy
Copy link
Owner

mrousavy commented Sep 2, 2024

-1

@howljs
Copy link

howljs commented Sep 2, 2024

-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
Copy link

maukoese commented Sep 3, 2024

+1

@MikhailR1337
Copy link

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

still the same issue during the building process on IOS

@baronha
Copy link

baronha commented Sep 10, 2024

+1

@amutsch
Copy link

amutsch commented Sep 10, 2024

+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 #731 (comment)

@batcodegen
Copy link

batcodegen commented Sep 15, 2024

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
Copy link

@batcodegen Both links do not show any information.

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 a pull request may close this issue.