-
Notifications
You must be signed in to change notification settings - Fork 7
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
IOS build fails on various h file issues, this time 'react/renderer/graphics/float.h' file not found ( after upgrade ) #506
Comments
have you tried to:
Also, if you are upgrading, why are you upgrading to 0.73 rather than 0.75? You'll be forced to update again in a slightly more than a month, when we release 0.76 and 0.73 will go out of support... |
I have tried the above and its not helping maybe because of our complex Podfile, we are embedding some native libs that need some setting changes as they come from external companies and do not come as react native ready api's. As for your question regarding the upgrade, we tried to upgrade directly to 0.75.3 but got so many issues and errors we decide the best is to do incremental upgrade and handle each issue when it arrives. As for the coming version 0.76 with the new debugger we would love it, yet we decided to start incorporating expo into the app, and the latest expo is using react native 0.74.x |
Can you share the Podfile? We streamlined it a lot so I think that I can help with it.
I understand. In some cases, especially if there is not a lot of native code, it might be easier to create a new Project with 0.75 and copy over the TS code and the few native files that you might have.
Actually, the Expo team is working to have SDK 51 to support both 0.74 and 0.75. I couldn't find a source or a guide for that now, but I'll get back to you as soon as I find it. |
Gladly thank you very much # Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
platform :ios, 14.0
use_frameworks!
prepare_react_native_project!
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# ```js
# module.exports = {
# dependencies: {
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# ```
# flipper_config = ENV['WITH_FLIPPER'] == "1" ? FlipperConfiguration.enabled(["Debug"], { 'Flipper' => '0.108.0' }) : FlipperConfiguration.disabled
# linkage = ENV['USE_FRAMEWORKS']
# if linkage != nil
# Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
# use_frameworks! :linkage => linkage.to_sym
# end
install! 'cocoapods', :deterministic_uuids => false
abstract_target 'VennBase' do
# React Native Maps dependencies
# The following line is only needed if building on an Apple silicon Mac without rosetta.
pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/Simon-TechForm/google-maps-ios-utils.git', :branch => 'feat/support-apple-silicon'
rn_maps_path = '../node_modules/react-native-maps'
pod 'react-native-google-maps', :path => rn_maps_path
config = use_native_modules!
$dynamic_framework = ['OpenpathMobile', 'AWSCore', 'AWSIoT', 'AWSLogs', 'XCGLogger', 'ObjcExceptionBridging', 'ReachabilitySwift', 'OpenSSL-Universal', 'JOSESwift', 'JWTDecode', 'DictionaryCoder', 'PromiseKit', 'CryptoSwift', 'IOSSecuritySuite', 'OpenpathMobile/Core', 'SwiftCBOR']
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if !$dynamic_framework.include?(pod.name)
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
use_react_native!(
:path => config[:reactNativePath],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
:flipper_configuration => FlipperConfiguration.disabled,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
# Manually (not autolinked pods)
pod 'Firebase/Analytics' # add the Firebase pod for Google Analytics
pod 'Firebase/Messaging' # Add the pod for Firebase Cloud Messaging
pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
pod 'react-native-geolocation', path: '../node_modules/@react-native-community/geolocation'
pod 'OpenpathMobile', path: './OpenpathMobile-0.4.4'
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
pod 'Permission-PhotoLibraryAddOnly', :path => "#{permissions_path}/PhotoLibraryAddOnly"
pod 'Permission-BluetoothPeripheral', :path => "#{permissions_path}/BluetoothPeripheral"
pod 'AppAuth'
target 'Venn' do
# add target specific code
end
target 'VennDevelopment' do
# add target specific code
end
app_ios_deployment_target = Gem::Version.new('13.4') # Change to your current deployment target
post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if [
"React-cxxreact",
"React-utils",
"React-NativeModulesApple",
"React-jserrorhandler",
"React-ImageManager",
"React-graphics",
"React-Fabric",
"ReactCommon",
"RNReanimated",
"React-Codegen",
"React-RCTNetwork",
"React-RCTVibration",
"React-RCTSettings",
"React-RCTLinking",
"React-RCTAnimation",
"React-RCTImage",
"React-RCTBlob",
"React-CoreModules",
"React-RCTAppDelegate"
].any? { |t| t == target.name }
config.build_settings["HEADER_SEARCH_PATHS"] ||= "$(inherited) "
config.build_settings["HEADER_SEARCH_PATHS"] << "${PODS_ROOT}/../../node_modules/react-native/ReactCommon "
config.build_settings["HEADER_SEARCH_PATHS"] << "${PODS_ROOT}/../../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios/ "
config.build_settings["HEADER_SEARCH_PATHS"] << "${PODS_ROOT}/../../node_modules/react-native/ReactCommon/react/nativemodule/core/ "
end
end
end
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
end
if $dynamic_framework.include?(target.name)
target.build_configurations.each do |config|
# Example: Accessing and modifying a specific build setting
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
target.build_configurations.each do |config|
pod_ios_deployment_target = Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
if pod_ios_deployment_target <= app_ios_deployment_target
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.4'
end
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
end
#target.build_configurations.each do |config|
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
#end
end
end
end
The "cleaner" version that pases now the build just fails when the App try to run and access openpath which I removed for this try: # Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
platform :ios, min_ios_version_supported
prepare_react_native_project!
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
abstract_target 'venn' do
config = use_native_modules!
# React Native Maps dependencies
# The following line is only needed if building on an Apple silicon Mac without rosetta.
pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/Simon-TechForm/google-maps-ios-utils.git', :branch => 'feat/support-apple-silicon'
rn_maps_path = '../node_modules/react-native-maps'
pod 'react-native-google-maps', :path => rn_maps_path
use_react_native!(
:path => config[:reactNativePath],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
:flipper_configuration => FlipperConfiguration.disabled,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
# Manually (not autolinked pods)
pod 'Firebase/Analytics' # add the Firebase pod for Google Analytics
pod 'Firebase/Messaging' # Add the pod for Firebase Cloud Messaging
pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
pod 'react-native-geolocation', path: '../node_modules/@react-native-community/geolocation'
# pod 'OpenpathMobile', path: './OpenpathMobile-0.4.4'
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
pod 'Permission-PhotoLibraryAddOnly', :path => "#{permissions_path}/PhotoLibraryAddOnly"
pod 'Permission-BluetoothPeripheral', :path => "#{permissions_path}/BluetoothPeripheral"
pod 'AppAuth'
target 'Venn' do
# add target specific code
end
target 'VennDevelopment' do
# add target specific code
end
post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
end
end |
regarding "I understand. In some cases, especially if there is not a lot of native code, it might be easier to create a new Project with 0.75 and copy over the TS code and the few native files that you might have." I actually tried doing something like that - created a latest expo project and started moving our files into it, but its taking time and we do not know how much of it we will spend to fix all configurations done historically on the native sides of android and ios. |
The cleaner version is the correct one. The only change I can suggest there is: - pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/Simon-TechForm/google-maps-ios-utils.git', :branch => 'feat/support-apple-silicon'
- rn_maps_path = '../node_modules/react-native-maps'
- pod 'react-native-google-maps', :path => rn_maps_path
use_react_native!(
:path => config[:reactNativePath],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
:flipper_configuration => FlipperConfiguration.disabled,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
+ pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/Simon-TechForm/google-maps-ios-utils.git', :branch => 'feat/support-apple-silicon'
+ rn_maps_path = '../node_modules/react-native-maps'
+ pod 'react-native-google-maps', :path => rn_maps_path Which basically means to move ALL the The other question I have is: do you really need to manually link these pods? pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/Simon-TechForm/google-maps-ios-utils.git', :branch => 'feat/support-apple-silicon'
rn_maps_path = '../node_modules/react-native-maps'
pod 'react-native-google-maps', :path => rn_maps_path
pod 'Firebase/Analytics' # add the Firebase pod for Google Analytics
pod 'Firebase/Messaging' # Add the pod for Firebase Cloud Messaging
pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
pod 'react-native-geolocation', path: '../node_modules/@react-native-community/geolocation'
# pod 'OpenpathMobile', path: './OpenpathMobile-0.4.4'
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
pod 'Permission-PhotoLibraryAddOnly', :path => "#{permissions_path}/PhotoLibraryAddOnly"
pod 'Permission-BluetoothPeripheral', :path => "#{permissions_path}/BluetoothPeripheral"
pod 'AppAuth' when you run Also, if this file fails only because of |
We're closing all the "Type: Upgrade Issue" in this repo as we're using it only for pick requests. If you're still having this problem, please open an issue on: |
Old Version
0.72.17
New Version
0.73.9
Description
We got a compilation error on IOS when upgrading from 0.72.x to 0.73.x
All this is happening during an incremental upgrade from 0.71.1 to 0.73.x
while at the upgrade to 0.72.x we got errors like 'react/debug/react_native_assert.h' file not found and resolved it using update of the search path using the Podfile like this:
After 0.72.x seems to be stable we have upgraded to 0.73.9 and then during the build got the :
'react/renderer/graphics/Float.h' file not found
By changing the Podfile hack to include this missing h file path:
By adding one more line to the code above:
config.build_settings["HEADER_SEARCH_PATHS"] << "${PODS_ROOT}/../../node_modules/react-native/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics "
We reached a new error:
Use of undeclared identifier 'FLT_MAX'
This seems like a problem created because of the fix for the previous problems with the search paths,
Any help will be appreciated :)
Steps to reproduce
We took our old version 0.71.1 project and upgraded it according to the instructions to 0.73.x
As per the description fo the error in the bug description the build fails with missing h file errors
Affected Platforms
Build - MacOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
The reproducer is not ready - I am working on it - need to create an old project of rn 0.71 and try to upgrade it and see if it reproduces
https://github.com/noamyagil/rn-upgrade-err-073/
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: