mixpanel-react-native icon indicating copy to clipboard operation
mixpanel-react-native copied to clipboard

App build fails on iOS 14.5

Open cigaciga opened this issue 5 years ago • 45 comments

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.

taschik avatar Apr 28 '21 00:04 taschik

+1. Disabled mixpanel until it's fixed

AndreasGS avatar Apr 28 '21 07:04 AndreasGS

same here

VincentQuillien avatar Apr 28 '21 16:04 VincentQuillien

Sorry guys! We are looking into this now.

zihejia avatar Apr 28 '21 20:04 zihejia

+1

mavarazy avatar Apr 29 '21 08:04 mavarazy

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

kkelley-leftbrain avatar Apr 29 '21 20:04 kkelley-leftbrain

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 Settings of your project, search for Library Search Paths

  • remove $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) image

  • add an empty swift file to your iOS target and create the Bridging Header when prompt image

zihejia avatar Apr 29 '21 21:04 zihejia

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.

zihejia avatar Apr 29 '21 22:04 zihejia

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 Settings of your project, search for Library Search Paths
  • remove $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) image
  • add an empty swift file to your iOS target and create the Bridging Header when prompt image

Guys - this has been open since April. It is now August. Shouldn't have this been handled without this extra work?

Thanks in advance.

checklist avatar Aug 16 '21 06:08 checklist

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?)?

jckw avatar Sep 01 '21 14:09 jckw

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! :)

IdrisHanafi avatar Sep 11 '21 15:09 IdrisHanafi

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

ekram21 avatar Sep 27 '21 15:09 ekram21

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.

zihejia avatar Sep 28 '21 06:09 zihejia

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)

mikehardy avatar Sep 28 '21 14:09 mikehardy

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

ololoepepe avatar Oct 11 '21 13:10 ololoepepe

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 avatar Oct 11 '21 14:10 mikehardy

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

ololoepepe avatar Oct 12 '21 06:10 ololoepepe

RN 0.66 gives the same error, by the way.

ololoepepe avatar Oct 12 '21 07:10 ololoepepe

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

mikehardy avatar Oct 12 '21 11:10 mikehardy

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.

mikehardy avatar Oct 12 '21 11:10 mikehardy