Closed castrostevenfox closed 1 year ago
Hello @castrostevenfox ,
Please replace below code in , in-app-payments-react-native-plugin/react-native-in-app-payments-quickstart/ios/Podfile
From , post_install do |installer| react_native_post_install(installer) end
To , post_install do |installer| react_native_post_install(installer) installer.pods_project.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" end end
and then install pod using : arch -x86_64 pod install
let us know if you still facing same issue ! Thank you !
YOU ARE THE MAN! Thank you!
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, min_ios_version_supported
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['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
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
target 'HealthyFresh' do
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
:flipper_configuration => flipper_config,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'HealthyFreshTests' do
inherit! :complete
# Pods for testing
end
post_install do |installer|
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
end
Then
cd ios && arch -x86_64 pod install
yarn run ios
All Good!
Steps to Reproduce:
Initialize a new project npm i install react-native-square-in-app-payments npx pod-install npm run ios
error
package json
Pod file
CHAT GPTS Response
This error message is indicating that the linker is unable to find certain symbols (specifically, the "OBJC_CLASS$_RCTAppDelegate", "OBJC_CLASS$_RCTBundleURLProvider", and "OBJC_METACLASS$_RCTAppDelegate" symbols) for the x86_64 architecture. These symbols are likely related to React Native and the RCTAppDelegate and RCTBundleURLProvider classes. The warning message is indicating that the linker is trying to link a library built for iOS Simulator-arm64 but the current build target is for iOS Simulator-x86_64. This means that the library and the target architecture of the build are not compatible. It seems that the library libevent is being built for the wrong architecture. To fix this, you may need to verify that the architecture of the libevent library is set to match the architecture of the build target. Verify that the version of react-native you are using is compatible with the version of XCode and the simulator you are using. It is also possible that the issue is caused by a missing or incorrect library import path, you should check the library import paths are correct in the project's build settings.