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

IOS build fails on various h file issues, this time 'react/renderer/graphics/float.h' file not found ( after upgrade ) #506

Closed
noamyagil opened this issue Sep 18, 2024 · 7 comments

Comments

@noamyagil
Copy link

noamyagil commented Sep 18, 2024

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:

    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

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
Screenshot 2024-09-18 at 16 41 22

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'

Screenshot 2024-09-18 at 16 48 52

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

System:
  OS: macOS 14.6.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 125.30 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.19.0
    path: ~/.nvm/versions/node/v18.19.0/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.2.3
    path: ~/.nvm/versions/node/v18.19.0/bin/npm
  Watchman:
    version: 2024.09.09.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK:
    API Levels:
      - "28"
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 30.0.2
      - 30.0.3
      - 33.0.0
      - 34.0.0
      - 35.0.0
    System Images:
      - android-30 | Google APIs ARM 64 v8a
      - android-31 | Google APIs ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
      - android-34 | Google Play ARM 64 v8a
      - android-35 | Google Play Experimental 16k Page Size ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2412.12266719
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.12
    path: /usr/bin/javac
  Ruby:
    version: 3.3.5
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 12.3.7
    wanted: ^12.1.1
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.9
    wanted: ^0.73.9
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

info React Native v0.75.3 is now available (your project is running on v0.73.9).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.75.3
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.75.3
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".

Stacktrace or Logs

The following build commands failed:
	CompileC /Users/Noam/Library/Developer/Xcode/DerivedData/Venn-dwduwwhmdhvakzdmwlkrovjmcxmr/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-ImageManager.build/Objects-normal/arm64/ImageRequest.o /Users/Noam/WebstormProjects/mobile-app-upgrade-73/node_modules/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/ImageRequest.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-ImageManager' from project 'Pods')
	SwiftCompile normal arm64 Compiling\ PrimitiveSequence.swift,\ PrimitiveSequence+Concurrency.swift,\ PrimitiveSequence+Zip+arity.swift,\ PriorityQueue.swift,\ Producer.swift,\ PublishSubject.swift,\ Queue.swift,\ Range.swift,\ Reactive.swift,\ RecursiveLock.swift,\ RecursiveScheduler.swift,\ Reduce.swift,\ RefCountDisposable.swift,\ Repeat.swift,\ ReplaySubject.swift,\ RestoredState.swift,\ RetryWhen.swift,\ Rx.swift,\ RxCBCentralManager.swift,\ RxCBCharacteristic.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Traits/PrimitiveSequence/PrimitiveSequence.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Traits/PrimitiveSequence/PrimitiveSequence+Concurrency.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Traits/PrimitiveSequence/PrimitiveSequence+Zip+arity.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Observables/Producer.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Subjects/PublishSubject.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Platform/DataStructures/Queue.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Observables/Range.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Reactive.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Platform/RecursiveLock.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Schedulers/RecursiveScheduler.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Observables/Reduce.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Disposables/RefCountDisposable.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Observables/Repeat.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Subjects/ReplaySubject.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxBluetoothKit/RestoredState.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Observables/RetryWhen.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxSwift/Rx.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxBluetoothKit/RxCBCentralManager.swift /Users/Noam/WebstormProjects/mobile-app-upgrade-73/ios/Pods/MultiplatformBleAdapter/iOS/RxBluetoothKit/RxCBCharacteristic.swift (in target 'MultiplatformBleAdapter' from project 'Pods')
(2 failures)

node:child_process:965
    throw err;
    ^

Error: Command failed: arch -x86_64 npx react-native run-ios
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at runCommand (/Users/Noam/WebstormProjects/mobile-app-upgrade-73/scripts/rn-ios.js:9:3)
    at Object.<anonymous> (/Users/Noam/WebstormProjects/mobile-app-upgrade-73/scripts/rn-ios.js:52:1)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Module._load (node:internal/modules/cjs/loader:1013:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 8266,
  stdout: null,

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

@cipolleschi
Copy link
Collaborator

have you tried to:

  1. from the iOS folder, run bundle exec pod deintegrate
  2. remove node_modules from the root folder
  3. rerun yarn install
  4. rerun bundle exec pod install in the iOS folder?

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...

@noamyagil
Copy link
Author

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.
I am trying now to clean the Podfile and rerun without the special configurations.

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.
This way we can still have a ready app after the upgrade for 0.72.x in one week while direct upgrade all the way will take way more time with black holes regarding how many days to finish.

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
So right now the plan is to upgrade to 0.74.x , then incorporate expo and then upgrade with it when the time comes

@cipolleschi
Copy link
Collaborator

@noamyagil

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.
I am trying now to clean the Podfile and rerun without the special configurations.

Can you share the Podfile? We streamlined it a lot so I think that I can help with it.

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.
This way we can still have a ready app after the upgrade for 0.72.x in one week while direct upgrade all the way will take way more time with black holes regarding how many days to finish.

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.

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
So right now the plan is to upgrade to 0.74.x , then incorporate expo and then upgrade with it when the time comes

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.

@noamyagil
Copy link
Author

noamyagil commented Sep 20, 2024

Gladly thank you very much
After your feedback I got the idea the mess in it is the problem.
I have prepared a cleaner podfile taking from the upgrade helper a cleaner version of the files and the build passes. ( fails during the run as js does not find the removed openpath modules )
and the previous file with all the "hacks" fails
The failing one that includes also the h file hack we found in a few of the web threads around this issue:

# 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

@noamyagil
Copy link
Author

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.

@cipolleschi
Copy link
Collaborator

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 pod statements below the use_react_native! call. The reason is that we setup some environment variables in the use_react_native! function that other pods might need. But if you install those pods before calling the use_react_native! function, those variables would not be set properly.

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 yarn add <package>, autolinking will run. So, in theory, you should not need to manually specify react-native-google-maps, Firebase packages, BVLinearGradient and react-native-geolocation.
Not sure about the Permission library.

Also, if this file fails only because of OpenpathMobile, I think you are on the right path! 😄

@cortinico
Copy link
Collaborator

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:
https://github.com/facebook/react-native/issues/new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants