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

[RN 0.75 new arch] 'utils/RectUtil.h' file not found #2306

Closed
jankosecki opened this issue Aug 14, 2024 · 18 comments · Fixed by #2319
Closed

[RN 0.75 new arch] 'utils/RectUtil.h' file not found #2306

jankosecki opened this issue Aug 14, 2024 · 18 comments · Fixed by #2319
Assignees
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided

Comments

@jankosecki
Copy link

jankosecki commented Aug 14, 2024

Description

Hi team,

I've been testing upgrading RN 0.74 to 0.75-RC7 with basic stack including react-navigation and react-native-screens.
The iOS build fails for me with the following error:

In file included from /Users/jkosecki/repos/custom/ReactNativeUpgradeTester/node_modules/react-native-screens/ios/RNSScreen.mm:15:
/Users/jkosecki/repos/custom/ReactNativeUpgradeTester/node_modules/react-native-screens/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h:10:10: fatal error: 'utils/RectUtil.h' file not found
#include "utils/RectUtil.h"

I have applied the following patch locally (included in the reproduction repo):

diff --git a/node_modules/react-native-screens/RNScreens.podspec b/node_modules/react-native-screens/RNScreens.podspec
index be7cc24..14cd2e4 100644
--- a/node_modules/react-native-screens/RNScreens.podspec
+++ b/node_modules/react-native-screens/RNScreens.podspec
@@ -27,7 +27,7 @@ Pod::Spec.new do |s|
     s.subspec "common" do |ss|
       ss.source_files         = ["common/cpp/**/*.{cpp,h}", "cpp/**/*.{cpp,h}"]
       ss.header_dir           = "rnscreens"
-      ss.pod_target_xcconfig  = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/common/cpp\"" }
+      ss.pod_target_xcconfig  = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/common/cpp/react/renderer/components/\"" }
     end
   end
 

but I'm not sure if that's correct way to fix this issue.

Steps to reproduce

  1. Remove patches/react-native-screens+3.34.0.patch
  2. Run yarn setup && yarn ios

Snack or a link to a repository

https://github.com/jankosecki/react-native-upgrade-tester/tree/rn-0.75

Screens version

3.34.0

React Native version

0.75-RC7

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

None

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 Aug 14, 2024
@necmettindev
Copy link

same issue

2 similar comments
@nthtrung09it
Copy link

same issue

@rayson-intrack
Copy link

same issue

@tboba tboba self-assigned this Aug 19, 2024
@tboba
Copy link
Member

tboba commented Aug 19, 2024

Hey, thanks for posting this issue!
Unfortunately, I can't reproduce this bug with the reproducer you provided. After removing patch I'm not receiving any error during the pod install phase, nor the compile phase.
Is this reproducer correct? I can't find any line for enabling new architecture in this repro 🤔

@tboba tboba added the Close when stale This issue is going to be closed when there is no activity for a while label Aug 19, 2024
@0xDing
Copy link

0xDing commented Aug 19, 2024

same issue +1

@github-actions github-actions bot removed the Close when stale This issue is going to be closed when there is no activity for a while label Aug 19, 2024
@tboba
Copy link
Member

tboba commented Aug 20, 2024

@necmettindev @nthtrung09it @rayson-intrack @0xDing could you provide a reproducer that reproduces this issue? As I said above, I didn't manage to deduce any bug from provided RN project (even after removing the patch).

@jankosecki
Copy link
Author

@tboba
I can reproduce the issues using provided repo. I did the following steps:

  1. Delete patches/react-native-screens+3.34.0.patch
  2. Clean up node_modules in case patch already applied
  3. Run yarn setup (it invokes "pod-install": "(cd ./ios ; RCT_NEW_ARCH_ENABLED=1 USE_FRAMEWORKS=static bundle exec pod install --repo-update)" which enables new architecture)
  4. Open XCode to set up development team (provided repro contains None team in Signing & Capabilities)
  5. Run yarn start
  6. Run yarn ios or trigger build from XCode (yarn ios causes a massive error output with different "error" lines but XCode offers a clear reason:
    image

@matinzd
Copy link

matinzd commented Aug 20, 2024

This is also happening in 0.75.2. Seems like there is something wrong with the pod installation in 75.

I tried this patch but it didn't work. (Fixed the issue but other errors started to come up)

diff --git a/node_modules/react-native-screens/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h b/node_modules/react-native-screens/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h
index 37aac4e..5fb5505 100644
--- a/node_modules/react-native-screens/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h
+++ b/node_modules/react-native-screens/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h
@@ -6,8 +6,8 @@
 #include <react/debug/react_native_assert.h>
 #include <react/renderer/components/rnscreens/Props.h>
 #include <react/renderer/core/ConcreteComponentDescriptor.h>
+#include <react/renderer/components/rnscreens/utils/RectUtil.h>
 #include "RNSScreenShadowNode.h"
-#include "utils/RectUtil.h"
 
 namespace facebook {
 namespace react {

With that being said, there is something wrong with the headers linking.

New arch is turned on.

@FurySwordXD
Copy link

FurySwordXD commented Aug 22, 2024

Can reproduce on RN 0.75.2.
Using this patch seems to fix it.

This is also happening in 0.75.2. Seems like there is something wrong with the pod installation in 75.

I tried this patch but it didn't work. (Fixed the issue but other errors started to come up)

diff --git a/node_modules/react-native-screens/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h b/node_modules/react-native-screens/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h
index 37aac4e..5fb5505 100644
--- a/node_modules/react-native-screens/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h
+++ b/node_modules/react-native-screens/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h
@@ -6,8 +6,8 @@
 #include <react/debug/react_native_assert.h>
 #include <react/renderer/components/rnscreens/Props.h>
 #include <react/renderer/core/ConcreteComponentDescriptor.h>
+#include <react/renderer/components/rnscreens/utils/RectUtil.h>
 #include "RNSScreenShadowNode.h"
-#include "utils/RectUtil.h"
 
 namespace facebook {
 namespace react {

With that being said, there is something wrong with the headers linking.

New arch is turned on.

@matinzd Could you highlight what are the other errors that were introduced, I don't use this library directly but through "react-navigation" and I don't face any other issues/errors.

@WoLewicki
Copy link
Member

#include <react/renderer/components/rnscreens/utils/RectUtil.h> instead of #include "utils/RectUtil.h" seems to work in my setups.

@cjones26
Copy link

Same issue +1

@TowhidKashem
Copy link

same issue +1

@tboba
Copy link
Member

tboba commented Aug 26, 2024

@matinzd this patch sounds better. Thanks!

@matinzd
Copy link

matinzd commented Aug 26, 2024

Should I open a PR for that? Is that gonna break paper builds?

@tboba
Copy link
Member

tboba commented Aug 26, 2024

@matinzd Nope, it shouldn't. C++ layer is being built only on new architecture, so the old arch should work well 👍

tboba added a commit that referenced this issue Aug 27, 2024
…ts (#2319)

## Description

In the newest version of screens, there's a bug where compiler can't
find RectUtil.h file from `utils/RectFile.h` during the compile phase of
RNSScreenComponentDescriptor file.
This PR fixes this by changing the path of RectUtil.h file to
<react/renderer/components/rnscreens/util/RectFile.h> file.

Fixes #2306.

## Changes

- Changed import of RectUtil.h file in RNSScreenComponentDescriptor.h
file

## Test code and steps to reproduce

- Download reproducer from
https://github.com/jankosecki/react-native-upgrade-tester/tree/rn-0.75
- Delete patches/react-native-screens+3.34.0.patch
- Clean up node_modules in case patch already applied
- Run yarn setup (it invokes "pod-install": "(cd ./ios ;
RCT_NEW_ARCH_ENABLED=1 USE_FRAMEWORKS=static bundle exec pod install
--repo-update)" which enables new architecture)
- Open XCode to set up development team (provided repro contains None
team in Signing & Capabilities)
- Run yarn start
- Run yarn ios or trigger build from XCode (yarn ios causes a massive
error output with different "error" lines but XCode offers a clear
reason.

## Checklist

- [ ] Ensured that CI passes
@matinzd
Copy link

matinzd commented Sep 13, 2024

Any plans to release this change?

@cjones26
Copy link

It's been almost two months...this may hold up one of our releases and we really don't want to have to fork. Can you please provide a timeline on when it will be published?

@jaaywags
Copy link

#include <react/renderer/components/rnscreens/utils/RectUtil.h>

YES this worked for me too! Not ideal solution but at least we can move forward until the fix is released.

ja1ns pushed a commit to WiseOwlTech/react-native-screens that referenced this issue Oct 9, 2024
…ts (software-mansion#2319)

## Description

In the newest version of screens, there's a bug where compiler can't
find RectUtil.h file from `utils/RectFile.h` during the compile phase of
RNSScreenComponentDescriptor file.
This PR fixes this by changing the path of RectUtil.h file to
<react/renderer/components/rnscreens/util/RectFile.h> file.

Fixes software-mansion#2306.

## Changes

- Changed import of RectUtil.h file in RNSScreenComponentDescriptor.h
file

## Test code and steps to reproduce

- Download reproducer from
https://github.com/jankosecki/react-native-upgrade-tester/tree/rn-0.75
- Delete patches/react-native-screens+3.34.0.patch
- Clean up node_modules in case patch already applied
- Run yarn setup (it invokes "pod-install": "(cd ./ios ;
RCT_NEW_ARCH_ENABLED=1 USE_FRAMEWORKS=static bundle exec pod install
--repo-update)" which enables new architecture)
- Open XCode to set up development team (provided repro contains None
team in Signing & Capabilities)
- Run yarn start
- Run yarn ios or trigger build from XCode (yarn ios causes a massive
error output with different "error" lines but XCode offers a clear
reason.

## Checklist

- [ ] Ensured that CI passes
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