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.72.1 use_frameworks fix for pod spec #1826

Closed
billnbell opened this issue Jul 12, 2023 · 9 comments
Closed

RN 0.72.1 use_frameworks fix for pod spec #1826

billnbell opened this issue Jul 12, 2023 · 9 comments
Labels
Missing repro This issue need minimum repro scenario Platform: iOS This issue is specific to iOS

Comments

@billnbell
Copy link

Description

react-native-screens+3.22.1.patch fix for new arch and 0.72.1

Test with cd ios && NO_FLIPPER=1 USE_FRAMEWORKS=static RCT_NEW_ARCH_ENABLED=1 pod install --repo-update && cd .. && yarn ios

diff --git a/node_modules/react-native-screens/RNScreens.podspec b/node_modules/react-native-screens/RNScreens.podspec
index 60b368e..b61f26c 100644
--- a/node_modules/react-native-screens/RNScreens.podspec
+++ b/node_modules/react-native-screens/RNScreens.podspec
@@ -4,8 +4,6 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
 
 fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
 
-folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
-
 Pod::Spec.new do |s|
   s.name         = "RNScreens"
   s.version      = package["version"]
@@ -20,34 +18,14 @@ Pod::Spec.new do |s|
   s.platforms    = { :ios => "9.0", :tvos => "11.0" }
   s.source       = { :git => "https://github.com/software-mansion/react-native-screens.git", :tag => "#{s.version}" }
 
+  s.source_files    = "ios/**/*.{h,m,mm,swift}"
+  s.requires_arc    = true
+  install_modules_dependencies(s)
   if fabric_enabled
-    s.pod_target_xcconfig = {
-      'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native"  "$(PODS_ROOT)/RCT-Folly"',
-      "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
-    }
-    s.platforms       = { ios: '11.0', tvos: '11.0' }
-    s.compiler_flags  = folly_compiler_flags + ' ' + '-DRCT_NEW_ARCH_ENABLED'
-    s.source_files    = 'ios/**/*.{h,m,mm,cpp}'
-    s.requires_arc    = true
-  
-    s.dependency "React"
-    s.dependency "React-RCTFabric"
-    s.dependency "React-Codegen"
-    s.dependency "RCT-Folly"
-    s.dependency "RCTRequired"
-    s.dependency "RCTTypeSafety"
-    s.dependency "ReactCommon/turbomodule/core"
-  
     s.subspec "common" do |ss|
       ss.source_files         = "common/cpp/**/*.{cpp,h}"
       ss.header_dir           = "rnscreens"
       ss.pod_target_xcconfig  = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/common/cpp\"" }
     end
-  else 
-    s.source_files = "ios/**/*.{h,m,mm}"
-    s.requires_arc = true
-  
-    s.dependency "React-Core"
-    s.dependency "React-RCTImage"
   end
 end

Steps to reproduce

See above

Snack or a link to a repository

none

Screens version

3.22.1

React Native version

0.72.1

Platforms

iOS

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added the Missing repro This issue need minimum repro scenario label Jul 12, 2023
@github-actions
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@github-actions github-actions bot added the Platform: iOS This issue is specific to iOS label Jul 12, 2023
@kkafar kkafar added the Close when stale This issue is going to be closed when there is no activity for a while label Jul 12, 2023
@kkafar
Copy link
Member

kkafar commented Jul 12, 2023

Hi @billnbell, would you mind describing what the issue is?

@tboba
Copy link
Member

tboba commented Jul 24, 2023

Hi @billnbell, as we didn't received any response for the past two weeks, we cannot provide any help for your issue.
If you think the problem should still be considered, please fill in appropriate steps to reproduce with minimal reproducible example and reopen this issue.

Thank you 👍

@tboba tboba closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2023
@tboba tboba removed the Close when stale This issue is going to be closed when there is no activity for a while label Jul 24, 2023
@Srpalkn
Copy link

Srpalkn commented Jul 24, 2023

@tboba hi I've faced with ‘react/debug/react_native_expect.h' file not found issue after upgrading React Native to 0.72.3 and installing pods with USE_FRAMEWORKS=static RCT_NEW_ARCH_ENABLED=1. This patch seems to fix that issue. My react-native-screens version is 3.22.1. I can give you more info about my configs if you wish.
Also you can check this discussion, seems like there will be a patch soon facebook/react-native#38188

@billnbell
Copy link
Author

Yeah it literally fixed the issues!!! :)

@tboba
Copy link
Member

tboba commented Jul 25, 2023

That's interesting 🤔 @billnbell if you think this issue occurs also in react-native-screens, would you mind creating a pull request with this patch? Have you also tested if this change is compatible with older versions of React Native and if it impacts old architecture?

@billnbell
Copy link
Author

It does impact older RN. You need to only apply

require "json"

package = JSON.parse(File.read(File.join(__dir__, "package.json")))
 
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
 
Pod::Spec.new do |s|
  s.name         = "RNScreens"
  s.version      = package["version"]
  s.summary      = package["description"]
  s.description  = <<-DESC
                  RNScreens - first incomplete navigation solution for your React Native app
                   DESC
  s.homepage     = "https://github.com/software-mansion/react-native-screens"
  s.license      = "MIT"
  # s.license    = { :type => "MIT", :file => "FILE_LICENSE" }
  s.author       = { "author" => "author@domain.cn" }
  s.platforms    = { :ios => "9.0", :tvos => "11.0" }
  s.source       = { :git => "https://github.com/software-mansion/react-native-screens.git", :tag => "#{s.version}" }

  s.source_files    = "ios/**/*.{h,m,mm,swift}"
  s.requires_arc    = true

if fabric_enabled
  install_modules_dependencies(s)
else
  s.source_files = "ios/**/*.{h,m,mm}"
  s.dependency "React-Core"
  s.dependency "React-RCTImage"
end

@tboba
Copy link
Member

tboba commented Jul 26, 2023

@billnbell After looking on it further I can say this change looks promising. However, as we discussed it with @kkafar we won't introduce that for now, as we want to keep control on the dependencies that are being injected.

However, we will consider replacing those lines in the future. Thanks for suggesting that! 🙏

@choijiho0021
Copy link

Of the 40 libraries I'm using, only this one specified the version in RCT-Folly, creating an error when installing New Arch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario Platform: iOS This issue is specific to iOS
Projects
None yet
Development

No branches or pull requests

5 participants