menu icon indicating copy to clipboard operation
menu copied to clipboard

[iOS] Fix "react_native_menu-Swift.h" cannot be found

Open alantoa opened this issue 9 months ago • 4 comments

Overview

CleanShot 2024-05-12 at 03 32 21@2x I noticed that many users have been facing this build error on iOS since the last version was released. It is due to a change made in this PR.

I assume that this import is correct, but I'm not sure why @svbutko still encountered this issue. Could you please check if the build error is related to this? Thank you!

Test Plan

After changing it to #import <react_native_menu/react_native_menu-Swift.h>, the error disappeared.CleanShot 2024-05-12 at 03 38 08@2x

alantoa avatar May 11 '24 19:05 alantoa

Hey, @alantoa, the issue to which you are referring was happening before my PR the issue happens in NEW ARCH, while my fix fixes it for OLD ARCH.

You can check the version to which people are referring is 1.0.2 and what they are using

And that it happened more than 2 days before my PR was merged and released

Are you sure that you are using OLD ARCH?

svbutko avatar May 11 '24 19:05 svbutko

Hey, @alantoa, the issue to which you are referring was happening before my PR the issue happens in NEW ARCH, while my fix fixes it for OLD ARCH.

You can check the version to which people are referring is 1.0.2 and what they are using

And that it happened more than 2 days before my PR was merged and released

Are you sure that you are using OLD ARCH?

is it possible for expo to auto upgrade this package when doing npx expo upgrade --fix?

Darren120 avatar May 11 '24 23:05 Darren120

Yeah, that's kind of weird. Ideally, it should work for both versions, but only v1.0.2 works for me. Let me take another look then.

alantoa avatar May 12 '24 20:05 alantoa

Yeah, that's kind of weird. Ideally, it should work for both versions, but only v1.0.2 works for me. Let me take another look then.

Wow, thanks, downgrade to v1.0.2 + Old Arch works now! Thanks! :)

"expo": "~51.0.8", "react-native": "0.74.1", "@react-native-menu/menu": "1.0.2",

Albert-Gao avatar May 20 '24 00:05 Albert-Gao

Any updates on this?

tompetk avatar May 25 '24 20:05 tompetk

This needs to be merged in as it's still a problem and it's causing build errors on iOS. Please merge this in asap @Naturalclar

sohail-wayland avatar May 28 '24 10:05 sohail-wayland

@sohail-wayland, hey, this depends on @Naturalclar. I'm not quite sure which one is actually correct. but for now, you can simply install v1.0.2, as its code is the same as this PR.

alantoa avatar May 28 '24 13:05 alantoa

+1 this is actively broken

awilson9 avatar May 29 '24 06:05 awilson9

image Having same issue

SohelIslamImran avatar May 31 '24 19:05 SohelIslamImran

Hey @Naturalclar - do you have the bandwidth to take a look at this?

fobos531 avatar Jun 11 '24 07:06 fobos531

image still have this error

thunderfalco avatar Jun 13 '24 05:06 thunderfalco

Hey! Thanks for this PR, but unfortunately for me it was the other way around - this PR broke the build now, while the previous release worked fine.

I think we should revert this, the previous way is the correct way of doing things (at least on latest Xcode).

Or maybe add an additional #if __has_include check to try both ways?

mrousavy avatar Jun 13 '24 09:06 mrousavy

Created a fix for this here: https://github.com/react-native-menu/menu/pull/832 cc @Naturalclar

mrousavy avatar Jun 13 '24 09:06 mrousavy

Thanks, Marc! Yeah, adding the #if __has_include condition should work for both cases.

alantoa avatar Jun 13 '24 11:06 alantoa

I'm curious why that works though. Why is it sometimes in a directory, and sometimes not?

mrousavy avatar Jun 13 '24 16:06 mrousavy

This error still comes up on the new arch. @alantoa

dancixx avatar Jun 17 '24 18:06 dancixx

hey @dancixx what if you were to use this patch? https://github.com/react-native-menu/menu/pull/832

alantoa avatar Jun 17 '24 20:06 alantoa