Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined symbols for architecture arm64 #2600

Closed
ankitbacancy opened this issue Jul 15, 2021 · 26 comments
Closed

Undefined symbols for architecture arm64 #2600

ankitbacancy opened this issue Jul 15, 2021 · 26 comments
Assignees
Labels

Comments

@ankitbacancy
Copy link

ankitbacancy commented Jul 15, 2021

🐛 Bug Report

Throws an error of arm 64 when running app from Xcode 12.4 to iOS 14.6

Undefined symbols for architecture arm64:
  "___cxa_increment_exception_refcount", referenced from:
      folly::cxxabi_cxa_exception_sans_reserve() in libFlipper-Folly.a(Exception.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

To Reproduce

Run app on device iPhone 12 contains iOS 14.6

Environment

Flipper Desktop version: .98.0
iOS: 14.6
XCode version: 12.4
react: 16.11.0
react-native: 0.62.2
device: iPhone 12
flipperkit version in Pods: 0.96.1

@atearjen
Copy link

atearjen commented Aug 5, 2021

same issue

@swrobel
Copy link

swrobel commented Aug 7, 2021

I can confirm that downgrading Flipper-Folly from 2.6.9 to 2.6.7, as recommended here and here, fixes the issue for me.

iOS: 14.7.1
XCode: 12.5.1
macOS: 11.5.1 (intel)
flipperkit: 0.102.0

@dinukasal
Copy link

This works @swrobel, Thanks!

@swrobel
Copy link

swrobel commented Sep 11, 2021

Is anyone from the Flipper team digging into this at all...?

@mweststrate
Copy link
Contributor

mweststrate commented Sep 11, 2021 via email

@morphytron
Copy link

Could you compare your setup against the reference project in this repo in the react native folder? Please note that we don't support building for M1's yet

On Sat, 11 Sep 2021, 06:22 Stefan Wrobel, @.***> wrote: Is anyone from the Flipper team digging into this at all...? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#2600 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN4NBFEOSNH3BCOLGVW7FLUBLRRFANCNFSM5ANEKJEQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

When might this be supported per chance? Thinking about returning my M1 for an Intel-based laptop. Thanks!

@mweststrate
Copy link
Contributor

mweststrate commented Sep 11, 2021 via email

@swrobel
Copy link

swrobel commented Sep 11, 2021

This is actually happening for me on an Intel Mac. I'm working on trying to get my project to build by trying various things people have said worked in github issues ... then I'll try the reference project.

@fkgozali
Copy link

I was looking at the original commit that added this callsite (see facebook/folly#1655):

facebook/folly@0fee9df

It looks like that commit added c++abi linker flag to the build file, which I don't think we ever had in RCT-Folly.podspec and perhaps Flipper-Folly.podspec? Perhaps the fix is to somehow add that flag?

cc @mweststrate

@mweststrate
Copy link
Contributor

@fkgozali / @swrobel interested in giving that a try? I'm still curious why it doesn't seem to be an issue with the reference project in that case (or is it?)

@yfeldblum
Copy link
Contributor

Right, the function __cxa_increment_exception_refcount is exported, on Apple platforms, by dylib c++abi rather than by the more common dylib c++. While c++ depends on c++abi, the platform seems not to use transitive dependencies when resolving symbols. Since folly uses that function now, its cmake build sets up that direct link-time dependency. Since flipper is not using that cmake build, flipper would need to take the same steps.

@mweststrate
Copy link
Contributor

Je n'ai aucune idée de ce que sont ces choses.

looping in @lblasa to read along.

@lblasa
Copy link
Contributor

lblasa commented Sep 15, 2021

@yfeldblum thanks for your comment. I'll try to look into this very shortly.

As @mweststrate pointed out, I do not understand why this is not an issue with the reference project?

@mweststrate
Copy link
Contributor

@lblasa seems we don't run against ARM64 in CI. Not sure anymore if that is intentional ('we don't support it') or due to CI limitations? https://github.com/facebook/flipper/blob/main/.github/workflows/iOS-Sample.yml#L30.

But for usage on Intel Macs in generally we don't need to build for ARM64 anyway correct? @swrobel are ARM64 builds deliberately targeted in your build process? (asking as someone who is an iOS noob, so this might be a stupid question)

@swrobel
Copy link

swrobel commented Sep 15, 2021

Wish I had the answer here but I guess React Native abstractions have rendered me ignorant. I just assumed since iOS devices are arm64 that the app has to be built for that platform for App Store submission.

@mikehardy
Copy link

I've been working to get react-native core and template to work on M1 macs and just for reference - related to a question above - I can say debug and release builds done on an M1 for simulator fail in different ways than release builds done on an intel mac (which do target arm64 as a cross-compile), despite their both being for arm64. Unexpected but widely reproduced experimental results there. Reference: facebook/react-native#31941

Also, I'm unaware of M1 abilities from CI providers at the moment in general, certainly not GitHub, unfortunately, so having this tested automatically is not possible anywhere at the moment, it's all done currently via folks like myself or reporters here running tests and reporting during react-native release process.

Happy to see any effort here or elsewhere ironing things out there, much appreciated

@lcruz09
Copy link

lcruz09 commented Sep 27, 2021

Same issue here:

iOS: 14.7.1
XCode: 12.5.1
macOS: 11.5.2 (2,6 GHz 6-Core Intel Core i7)
flipperkit: 0.108.0

@mikehardy
Copy link

I don't see any reproducible example here, so all I can say is "it works for me", so who's right? Is it working or is it not?
I can tell you that it works for me starting from npx react-native init --version 0.66.0-rc.4 so in my mind it is fixed in general but perhaps there is a corner case we are missing?

An example would cut through all confusion: https://stackoverflow.com/help/minimal-reproducible-example

@mikehardy
Copy link

Ah wait just saw this: fixed and already picked for 0.66, and likely after 0.65.1 so my testing sees it as already fixed: facebook/react-native@b0c8a4e

@felix-lambert
Copy link

felix-lambert commented Oct 7, 2021

For M1 devices, I've just commented this line in the Podfile if you want to build your binary on a physical device:

# use_flipper!({ 'Flipper' => '0.96.0', 'Flipper-Folly' => '2.6.7', 'Flipper-RSocket' => '~> 1.4' })

You can uncomment it for release build

@mweststrate
Copy link
Contributor

mweststrate commented Oct 7, 2021

@felix-lambert, looks like you are pointing to outdated versions, I recommend to either use use_flipper!() for the defaults of the React Native version you are using (should work on M1 icmw RN 0.66), or otherwise try the versions in our reference project: https://github.com/facebook/flipper/blob/main/react-native/ReactNativeFlipperExample/ios/Podfile#L30

@aigoncharov
Copy link
Member

I see it in our Sample iOS app as well. Downgrading to Flipper-Folly 2.6.7 helped.
CC @lblasa

@aigoncharov
Copy link
Member

Closed by db59652
Please, upgrade to Flipper-Folly 2.6.10.

@xilin
Copy link

xilin commented Nov 18, 2021

Closed by db59652 Please, upgrade to Flipper-Folly 2.6.10.

Can we also update the example podfile?

https://github.com/facebook/flipper/blob/main/react-native/ReactNativeFlipperExample/ios/Podfile

@lblasa
Copy link
Contributor

lblasa commented Nov 18, 2021

@xilin thanks for raising this, I will make the update.

facebook-github-bot pushed a commit that referenced this issue Nov 18, 2021
Summary:
This change bumps Flipper-Folly to the latest which fixes an issue with undefined symbols.

See #2600

Reviewed By: aigoncharov

Differential Revision: D32528018

fbshipit-source-id: 24458e43eedd4afad5049b72991bc5e013e67171
@fcaldarelli
Copy link

fcaldarelli commented Jan 20, 2023

In my case the problem was different.

I found that when launched pod install --verbose I saw that the branch version was different, in my case was 1.76.0.1.9. The 1.76.0.1.9 missed asm folder needed to link the code.

In the screen I put the right version.

Screenshot 2023-01-20 alle 10 46 28

To fix, call pod repo list and update the CDN (usually named as trunk) with

pod repo update trunk (if at your side is named trunk)

Launch again pod install --verbose and you will see the same and right version of the Pod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests