App build fails on iOS 14.5
I'm having an issue after upgrading to Xcode 12.5 and iOS 14.5, build is failing with error:
Undefined symbols for architecture x86_64: "Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer) -> (Swift.IndexingIterator<Swift._ArrayBuffer>, Swift.Int)", referenced from: generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray(A) -> Swift.ContiguousArray<A.Element> in libMixpanel-swift.a(AutomaticProperties.o) ld: symbol(s) not found for architecture x86_64
We discovered the same here, too.
+1. Disabled mixpanel until it's fixed
same here
Sorry guys! We are looking into this now.
+1
Hey all - there appears to be some workarounds for 0.64 and at least in my case, 0.63.3 found in the thread mentioned above. My solution was pulled from a lot of folks across a few issues, found here.
@zihejia not sure if this is potentially the solution here, as a lot of the pain is coming from the Big-Sur automatic updates jacking with XCode and a cascading number of libraries coupled with it. Always appreciate the work you guys are doing, thank you for the support
Cheers
Thanks @kkelley-leftbrain and everyone who brought this up and provided the valuable information. Here is the workaround based on the threads. Tested in Xcode 12.5 and RN 0.64
-
open the iOS project/workspace project file
-
go to the
Build Settingsof your project, search forLibrary Search Paths -
remove
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
-
add an empty swift file to your iOS target and create the Bridging Header when prompt

Feel free to reopen if the above solution doesn't work, or contact our support if you need to continue the conversation for any critical issues.
Thanks @kkelley-leftbrain and everyone who brought this up and provided the valuable information. Here is the workaround based on the threads. Tested in Xcode 12.5 and RN 0.64
- open the iOS project/workspace project file
- go to the
Build Settingsof your project, search forLibrary Search Paths- remove
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)- add an empty swift file to your iOS target and create the Bridging Header when prompt
Guys - this has been open since April. It is now August. Shouldn't have this been handled without this extra work?
Thanks in advance.
Should this issue be closed? There might be a work around but this doesn't feel fully solved. Do we know why the workaround works (and what does removing the library path do?)?
Using XCode 12.5.1 and RN 0.63.4. @zihejia
Couldn't find the $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) in my Library Search Paths. But I did try adding the bridging header but no luck (same error). Would love to see an updated status on this, thanks! :)
I Couldn't find the $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) in my Library Search Paths either. If this doesnt get resolved soon I may have to look for alternative to mixpanel.
Any ETA when will be resolved? @zihejia
hi @ekram21 @IdrisHanafi , would you like to check out the latest issue from RN about this? Unfortunately, this issue has still not been fully resolved and a workaround is still needed. It is not specific to Mixpanel but more related to RN with Xcode.
Coming over here from the related react-native issue, we've worked on this for the next release (0.66) of react-native and have implemented the required workarounds in a general way. This affects everyone using react-native so if you can please spread the word to other developers in any other repos you work in to help them out, pointing that related issue and encouraging them to examine the Podfile addition that helps people https://react-native-community.github.io/upgrade-helper/?from=0.65.1&to=0.66.0-rc.4 (check the Podfile workaround line that was added)
@zihejia So you say this is RN and Xcode issue, then how could it be that my project compiled fine with the same RN and Xcode versions until installing Mixpanel? The issue still exists and there is no workaround (at least for Xcode 12.5.1). The methods posted above does not work (at least for my case), as I do not have $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) path nor does the fix from https://github.com/facebook/react-native/issues/31480 help.
Perhaps mixpanel is the first Swift code you've ingested @ololoepepe ? There should be no problems like this on react-native 0.66 (released now).
@mikehardy Well, I have more than 60 native modules and some code in AppDelegate.m (if that counts). Surely I have faced some issues from time to time, but none was without a fix/workaround and developers saying "this is not our fault, we will not do anything to fix it".
As for upgrading RN version (mine is 0.64.2), it is hard or even impossible to just upgrade without breaking some package. I know one should upgrade from time to time, but doing it too often is a pain and waste of empolyer's money (especially when some packages break and one have to fix them).
RN 0.66 gives the same error, by the way.
I hear you. It's really not easy. Are you certain that on the upgrade to 66 you put the compile workaround function call in your podfile? Have you checked out the archs specifiers I slice in via podfile in react-native-firebase tests podfile? I don't have 60 native modules in my app but I maintain about 30 native modules and in my experience this is an xcode config issue that is out of module's control. I collaborated directly with the react-native team to add workarounds for that reason and we had no fail reports by the time we released 66
I have lots of caching so npx react-native-clean-project was needed in my case as well then pod reinstall and I blew away my ccache for good measure.