facebook / flipper

A desktop debugging platform for mobile developers.
https://fbflipper.com/
MIT License
13.33k stars 952 forks source link

Undefined symbols for architecture arm64 #2600

Closed ankitbacancy closed 2 years ago

ankitbacancy commented 3 years ago

🐛 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 commented 3 years ago

same issue

swrobel commented 3 years ago

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 commented 3 years ago

This works @swrobel, Thanks!

swrobel commented 3 years ago

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

mweststrate commented 3 years ago

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 https://github.com/facebook/flipper/issues/2600#issuecomment-917344018, 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.

morphytron commented 3 years ago

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 commented 3 years ago

Really hard to tell, its mostly downstream systems that make mobile dev hard on M1, some of our deps, Electron itself still dies, Android emulators...

On Sat, 11 Sep 2021, 12:39 Apatiga, Daniel, @.***> wrote:

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 … <#m6196904304097146813> 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) https://github.com/facebook/flipper/issues/2600#issuecomment-917344018>, 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!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/facebook/flipper/issues/2600#issuecomment-917392177, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN4NBFSLKA45TD7HCBIOM3UBM5VVANCNFSM5ANEKJEQ . 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.

swrobel commented 3 years ago

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 commented 3 years ago

I was looking at the original commit that added this callsite (see https://github.com/facebook/folly/issues/1655):

https://github.com/facebook/folly/commit/0fee9dfce93e42b33ca8fb2c455b1d7cce8bebce

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 commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

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

looping in @lblasa to read along.

lblasa commented 3 years ago

@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 commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

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: https://github.com/facebook/react-native/issues/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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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: https://github.com/facebook/react-native/commit/b0c8a4eee821ca0b22e166a2a38f2bd2f22a1abe

felix-lambert commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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

aigoncharov commented 2 years ago

Closed by https://github.com/facebook/flipper/commit/db59652d0ef2244228db4634c0b2cf9cf55239d4 Please, upgrade to Flipper-Folly 2.6.10.

xilin commented 2 years ago

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 commented 2 years ago

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

fcaldarelli commented 1 year ago

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.