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

Missing React-RCTImage dependency #2054

Closed
stianjensen opened this issue Feb 28, 2024 · 5 comments
Closed

Missing React-RCTImage dependency #2054

stianjensen opened this issue Feb 28, 2024 · 5 comments
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided

Comments

@stianjensen
Copy link

Description

When upgrading to react-native 0.73, I needed to upgrade react-native-screen to the latest version in order to make it build properly on Android.
Then I ran into an issue on iOS where React-RCTImage disappeared from the list of dependencies of RNScreens in Podfile.lock.

It looks like it stems from this commit, which first shipped with v3.26.0:
c3d1ae8

React-RCTImage is only added to the list of dependencies if you're running in a react-native environment without install_modules_dependencies.

The error I was getting was:

ld: Undefined symbols:
  _OBJC_CLASS_$_RCTImageLoader, referenced from:
       in RNSScreenStackHeaderConfig.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Patching the podspec locally to add back React-RCTImage (at least when running with new_arch_enabled == false, the only config I've tested so far), resolves the issue for me. Has it gotten lost in this case accidentally?

I can see from the PRs to the example repo here as well that the dep got lost when updating the version of react-native-screens used in the example repositories:
#1979

For context, I am running with use_frameworks! in my Podfile, but have seen no issues with that and react-native-screens until now.

Would it be possible to keep the dependency and thereby continue supporting this workflow?

Steps to reproduce

Install with use_frameworks! in your podfile, and then try to run on iOS.

Snack or a link to a repository

https://github.com/stianjensen/react-native-screens-test/tree/main

Screens version

3.29.0

React Native version

0.73.0

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided labels Feb 28, 2024
@kkafar
Copy link
Member

kkafar commented Feb 29, 2024

Yeah, this is rather unintended. Thanks for letting us know.

Most likely we will bring back react-image to our dependency list, as we directly consume it.

@WoLewicki
Copy link
Member

@stianjensen can you check if applying #2089 fixes the issue?

@stianjensen
Copy link
Author

@stianjensen can you check if applying #2089 fixes the issue?

Yes, looks like that solves it!


For completeness, it only worked for me when I applied it on v3.27.0 – on the latest version v3.30.1 I then ran into another linker error, but that probably warrants its own issue (I haven't tested the versions between 3.27 and 3.30.1 yet).

ld: Undefined symbols:
  facebook::jsi::HostObject::~HostObject(), referenced from:
      RNScreens::RNScreensTurboModule::RNScreensTurboModule(std::__1::function<std::__1::array<int, 2ul> (int)>, std::__1::function<void (int, double)>, std::__1::function<void (int, bool)>, std::__1::function<void (int)>) in RNScreensTurboModule.o
...

@tboba
Copy link
Member

tboba commented Apr 23, 2024

@stianjensen That's great, thanks for confirming this resolves your issue!
The PR with fix has been already merged (commit: 02154a9) and will land in the next release of Screens 🎉

Also, if the error with undefined symbol still happens to you, could you create separate issue with it? 🙏
Cheers

@tboba tboba closed this as completed Apr 23, 2024
@itlijunjie
Copy link

itlijunjie commented Apr 28, 2024

@stianjensen

Try adding the following code to the RNScreens.podspec file in v3.27.0.

if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
    s.dependency "hermes-engine"
else
    s.dependency "React-jsi"
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided
Projects
None yet
Development

No branches or pull requests

5 participants