pendo-io / pendo-mobile-sdk

Pendo captures product usage data, gathers user feedback, and lets you communicate in-app to onboard, educate, and guide users to value
https://www.pendo.io
Other
57 stars 2 forks source link

Unable to install React Native Pendo in Apple silicon for IOS #4

Closed vikas-0 closed 2 years ago

vikas-0 commented 2 years ago

after pod install, When I run react-native run-ios, I get following error

Create build description
Build description signature: <signature>
Build description path: /Users/<username>/Library/Developer/Xcode/DerivedData/<Project>/Build/Intermediates.noindex/XCBuildData/07aa4a489793fd54166-desc.xcbuild

note: Build preparation complete
note: Building targets in dependency order
/Users/<user>/Documents/Developement/mobile/ios/<Project>.xcodeproj: error: The linked library 'libPods-<Project>.a' is missing one or more architectures required by this target: x86_64. (in target '<Project>' from project '<Project>')

it is Apple Silicon Mac M1,

MikePendo commented 2 years ago

@vikas-0 Currently we ship native sdk for react native as static libraries, which unfortunately don't support M1 (I need to check how that support even possible for static libs). So officially we don't support it yet. I will look into it on Sunday to verify a proper work around for that case, meanwhile I can think of possible work arounds:

It should work if u open Xcode with Rosetta

I also see that current work around is: work around

#1 Install ffi
sudo arch -x86_64 gem install ffi

#2 Re-install dependencies
arch -x86_64 pod install

There is a thread in react native on how to support M1: react native m1 support

Can u please also share what react-native version u r using and your Xcode version. (so I could verify the work arounds)

vikas-0 commented 2 years ago

@vikas-0 Currently we ship native sdk for react native as static libraries, which unfortunately don't support M1 (I need to check how that support even possible for static libs). So officially we don't support it yet. I will look into it on Sunday to verify a proper work around for that case, meanwhile I can think of possible work arounds:

It should work if u open Xcode with Rosetta

I also see that current work around is: work around

#1 Install ffi
sudo arch -x86_64 gem install ffi

#2 Re-install dependencies
arch -x86_64 pod install

There is a thread in react native on how to support M1: react native m1 support

Can u please also share what react-native version u r using and your Xcode version. (so I could verify the work arounds)

Xcode version is 13.2.1, react native version 0.67.2.

Our all team uses M1 mac. is there any plan to support it in future? I am afraid if it impacts our workflow drastically or break other things.

vikas-0 commented 2 years ago

Also, the repo mentioned in https://www.npmjs.com/package/rn-pendo-sdk/v/2.13.1 is inaccessible. is it supposed to be like that?

MikePendo commented 2 years ago

yes, we are not open source.

MikePendo commented 2 years ago

@vikas-0 Have you been able to try one of the proposed work arounds above?

vikas-0 commented 2 years ago

@vikas-0 Have you been able to try one of the proposed workarounds above?

No, I couldn't find the time to try. We decided to go ahead for now without pendo. Perhaps, I'll look into it again, next week.

vikas-0 commented 2 years ago

I tried the workaround, I am still getting similar error. ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

MikePendo commented 2 years ago

@vikas-0 So I have looked again at the issue, As I mentioned we currently ship our native library as fat static library which will not work for the M1 as it can't contain two slices for arm64 (simulator, device)and that what cause the issue. The proper solution will be to ship it under XCframeworks, I will create a pr tmrw to fix this issue. (already tried it on my M1 and it looks fine), so I believe next week we will be able to release it. For right now the only solution I tried and it worked for me was to use Rosetta. I will update as soon as we release. Thanks

MikePendo commented 2 years ago

@vikas-0 The fix should be available in 2.14, with support to M1. Please notice we changed the installation instruction a little, in the AppDelegate.h you will need to add @import Pendo; (Obj-C) instead of #import "PendoManager.h" react native installation instructions I am closing the issue

vikas-0 commented 2 years ago

Thanks, now there is no building issue, but seems like your android package uses a very old Gradle version. I could have updated it by forking if there was a repo. :(

Edit: Seems like my workaround helped in getting past the Gradle version issue. I need to do some more testing.