menu: Build fails for iOS on react-native@0.74.1 with newArchEnabled and useFrameworks = static

Hi! First of all, thanks for the wonderful work on this package.

I have failed to make a build with react-native@0.74.1, newArchEnabled = true and useFrameworks = "static"

The error is as shown below

Compiling @react-native-menu/menu Pods/react-native-menu » MenuViewManager.mm
› Compiling @react-native-menu/menu Pods/react-native-menu » MenuView.mm

❌  (node_modules/@react-native-menu/menu/ios/NewArch/MenuView.mm:2:9)

  1 | #ifdef RCT_NEW_ARCH_ENABLED
> 2 | #import <react_native_menu-Swift.h>
    |         ^ 'react_native_menu-Swift.h' file not found
  3 | #import "MenuView.h"
  4 | 
  5 | #import <react/renderer/components/RNMenuViewSpec/ComponentDescriptors.h>

› Preparing react-native Pods/React-RCTImage » React-RCTImage-Info.plist

I am using @react-native-menu/menu@1.0.2

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 16
  • Comments: 16 (3 by maintainers)

Most upvoted comments

This patch solves it for me

index 6018cd1..23ef306 100644
--- a/node_modules/@react-native-menu/menu/ios/NewArch/MenuView.mm
+++ b/node_modules/@react-native-menu/menu/ios/NewArch/MenuView.mm
@@ -1,5 +1,5 @@
 #ifdef RCT_NEW_ARCH_ENABLED
-#import <react_native_menu-Swift.h>
+#import <react_native_menu/react_native_menu-Swift.h>
 #import "MenuView.h"
 
 #import <react/renderer/components/RNMenuViewSpec/ComponentDescriptors.h>

This patch solves it for me

index 6018cd1..23ef306 100644
--- a/node_modules/@react-native-menu/menu/ios/NewArch/MenuView.mm
+++ b/node_modules/@react-native-menu/menu/ios/NewArch/MenuView.mm
@@ -1,5 +1,5 @@
 #ifdef RCT_NEW_ARCH_ENABLED
-#import <react_native_menu-Swift.h>
+#import <react_native_menu/react_native_menu-Swift.h>
 #import "MenuView.h"
 
 #import <react/renderer/components/RNMenuViewSpec/ComponentDescriptors.h>

Lovely! This worked for me. Thanks a lot.

I’m getting this error:

Screenshot 2024-05-11 at 13 55 15

@rranjan14’s patch works for me, thank you! Would be great to get this fixed in @react-native-menu/menu

@rranjan14 what verson of react-native-menu do you have?

1.0.2

hmm, i’ve tried and it didn’t work for me