Closed nishkohli96 closed 3 years ago
I don't have a mac M1, but I don't see why it should cause any issue.
cd: symbol(s) not found for architecture x86_64
M1 is an ARM processor, maybe the command ran by yarn run-ios
is wrong? Which version of react-native are you using? Does it works if you open Xcode, clean the project build and run it from it instead?
This is subtle. The library works with M1. I've been working hard to clean up all the m1 build stuff for upcoming react-native 0.66 and it's possible to get it all to work but it's not easy. If you're on m1 I strongly recommend checking the react-native-firebase tests directory and looking at our Podfile. I maintain that and it's the best known combo of hacks to make things work on m1 and Intel Mac for debug and release mode, I keep it updated as it's how I prove out the work we're doing for the next release. Checking it's recent history of commits may be useful as well. The arch settings in particular may help this error
All right, thanks for your support
Of note also (now that I am on a real computer and can toss links around) is this specific comment which shows what that magic xcode workaround call is in the react-native-firebase Podfile: https://github.com/facebook/react-native/issues/31480#issuecomment-910019812 and you may also like https://github.com/facebook/react-native/issues/31941
@mikehardy did you have a chance to fix this?
@Dassine fix what exactly? M1s work fine as far as I know. You'll want a modern react-native (0.66 or higher) and you'll want this https://github.com/facebook/react-native/blob/ac206aa814c3c60eac86c2361c06f1aa41d8e85c/template/ios/Podfile#L34
But I don't currently have any M1 related issues.
@mikehardy thank you for quick answer. I'm getting the Undefined symbols for architecture x86_64
and this using RN 0.66
I already added __apply_Xcode_12_5_M1_post_install_workaround(installer)
@mikehardy do you see something wrong in my Podfile ?
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '11.0'
abstract_target 'Roo' do
config = use_native_modules!
# React Native Maps dependencies
rn_maps_path = '../node_modules/react-native-maps'
pod 'react-native-google-maps', :path => rn_maps_path
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => true
)
target 'RooMobile' do
#Production-specific pods
pod 'RNSVG', :path => '../node_modules/react-native-svg'
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
pod 'RNDateTimePicker', :path => '../node_modules/@react-native-community/datetimepicker'
pod 'react-native-date-picker', :path => '../node_modules/react-native-date-picker'
target 'RooMobileTests' do
inherit! :complete
# Pods for testing
end
end
target 'RooMobile-staging' do
#Staging-specific pods
end
target 'RooMobile-dev' do
#Development-specific pods
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
use_flipper!()
# use_flipper!({ 'Flipper' => '0.74.0' })
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
@mikehardy solved it. I needed to add
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
under my other targets.
Bug summary
I'm trying to use this lib on my M1 Mac, here is the error I get when I run
yarn ios
.Library version
3.0.5
Environment info
Steps to reproduce
Did exactly the steps mentioned in the documentation.
Ran app after running
npx pod-install
and eventually ran into the above error.Reproducible sample code