It is very new to me see this problem which started happening recently. Previously my app used to work fine on the iOS simulator by running this command react-native run-ios
. Now I have done a lot of research and made my app run via XCode. But somehow the metro bundler is not linked when the app runs via XCode.
I tried running the app via react-native run-ios
and every time I am seeing this error. It is too big to copy paste every error here, but here are some of them:
Undefined symbols for architecture x86_64:
"Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer<A>) -> (Swift.IndexingIterator<Swift._ArrayBuffer<A>>, Swift.Int)", referenced from:
generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray<A where A: Swift.Collection>(A) -> Swift.ContiguousArray<A.Element> in libMixpanel-swift.a(AutomaticProperties.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld /Users/careerlabsdev/Library/Developer/Xcode/DerivedData/CareerLabs_Elev8-gxcfanteiuxazegkgwkjkrjxbdmw/Build/Products/Debug-iphonesimulator/CareerLabs.app/CareerLabs normal
(1 failure)
I have done a lot of things to make it to work. The only success I got here is, while running the command react-native run-ios, it opens up the metro bundler server
. After that it fails with giving a 1000 lines of error. I picked the error which had some cream part. Some key words to pick from the error:
What I did is as follows:
npm install
and then cd ios && pod install
and then ran the command react-native run-ios
pod install
and then in the root react-native run-ios
rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate
pod setup
pod install
cd ..
react-native run-ios
react-native run-ios
build and run
the app successfully on XCode. But it doesn't get attached to the metro bundler server. Looks like it runs the release mode only.react-native-gesture-handler
to the latest one which is 1.10.3, to see if that removes my problem. But no luck.My Podfile look like this:
platform :ios, '10.0'
use_flipper!({'Flipper' => '0.81.0'})
post_install do |installer|
flipper_post_install(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
I am out of options now, and waiting for some insight to be given. It is indeed frustrating to see an error on something which never created a problem. I am using Apple M1 Chip Macbook.
Update V1.0
use_flipper!()
, from the /ios/Podfile
, and then redid the same things, like removing Pods
, Podfile.lock
. Running this command, pod update && pod install && cd.. && npm run ios
. Ran into multiple issues. I don't know what the issue is with XCode and React Native on Apple M1.Update V2.0
I have found some significant places where the developers are complaining about the same. XCode has forced updated my version to 12.5, without my notice. And now XCode is creating a problem with RN Older projects. Here are the supportive links for the same:
I hope this may give some insight to the developers who are confused like me. Please take a look, and looks like Facebook
is fixing it, but don't know when. Have to keep an eye on it :/
The one hacky thing which I did to make my app run again like before, is to downgrade the XCode Version to the previous stable one, that is Version 12.4. I knew about the problem later, because, XCode
force updated my version which started behaving weird with my already existing project. So the only viable option I saw is to downgrade the version to the previous one, and everything worked like before.
Please Note: This issue exists majorly with Apple M1
along with XCode v12.5
and BigSur OS
. So go ahead keeping these things in your mind.
For this, I had to do these things:
XCode
completely from the Mac. To do that efficiently, considering XCode
does caches a lot of things on your Mac, use Mac App Cleaner. If by any chance, you have just removed the XCode without using the link, then use this Completely remove Xcode from Mac.XCode
from this resource XCode Releases. Please Note: This is a legit source which takes you directly to the Apple's download pages
, and no unreliable thing. So you can just go ahead and download the previous stable version of the XCode
, with which your app was working fine.App Store
will again install the latest version of the XCode which is buggy v12.5
. So please don't download and install the same from Apple Store
. Use the above mentioned source only for best results.