Pushwoosh / pushwoosh-react-native-plugin

Other
57 stars 43 forks source link

Apple M1 issue #122

Closed molchanovskiy closed 3 years ago

molchanovskiy commented 3 years ago

When running project in for iOS getting error

ld: in /Users/a.mochanovskiy/Projects/pocketnest-react-native/ios/Pods/Pushwoosh/Framework/Pushwoosh.framework/Pushwoosh(libPushwoosh.a-arm64-master.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/a.mochanovskiy/Projects/pocketnest-react-native/ios/Pods/Pushwoosh/Framework/Pushwoosh.framework/Pushwoosh'

wfhm commented 3 years ago

@molchanovskiy,

I could not reproduce it so far. Could you please provide a bit more info on your environment and share the steps to reproduce the issue? What is the version of Pushwoosh plugin you use?

molchanovskiy commented 3 years ago

@wfhm Thank you for response. I am using this version and issue only appears on simulator when running on apple m1 Mac book pro, working fine on device

wfhm commented 3 years ago

@molchanovskiy,

Just tried it with iPhone 12 simulator (iOS 14.4), and it worked just fine on my side. What Xcode version do you use? Do you use New build system or the legacy one?

Also, could you please specify how exactly you add Pushwoosh plugin to your project?

molchanovskiy commented 3 years ago

@wfhm I am using new build system as it is default one and latest Xcode 12.4 tested on same iOS versions. I had added pushwoosh with "npm install pushwoosh-react-native-plugin" Are you testing on Apple M1 processor Mac book ?

wfhm commented 3 years ago

@molchanovskiy,

No, so far I can only check it with Intel-based devices. It looks like this is a common issue though, and there suggested solution is to exclude the arm64 architecture from your build. Under Targets, select your project -> Build Settings -> Excluded Architectures, and add Any IOS Simulator SDK : arm64 for both Debug and Release. Do the same for your Pods project.

More details here: https://dev.to/mngyuan/updating-react-native-projects-for-m1-mac-development-1mk4

I don't have an M1 device at hand, so I cannot check if this solution works, so please let us know about the results.

molchanovskiy commented 3 years ago

@wfhm No, that didn't helped. So I am going to test on devices only while fix will appear.

molchanovskiy commented 3 years ago

@wfhm It worked!!! https://stackoverflow.com/a/63955114 I was needed to update my Podfile to add arm64 to each pod

wfhm commented 3 years ago

@molchanovskiy great news, thanks for sharing the solution!