Ziggeo / ReactNativeSDK

React Native SDK
Apache License 2.0
7 stars 6 forks source link

building for iOS, but linking in dylib file built for iOS Simulator #54

Closed AaronCCWong closed 2 years ago

AaronCCWong commented 3 years ago

Hi,

I am trying to use Ziggeo with a react native project. I used the following steps to add this SDK to my project:

  1. npm install react-native-ziggeo-library --save
  2. react-native link
  3. Added pod 'iOS-Client-SDK', :git => 'https://github.com/Ziggeo/iOS-Client-SDK.git' to my Podfile
  4. pod install

I am able to build and run my app in a simulator but when I try to build on a real device I get the following error:

ld: building for iOS, but linking in dylib file (/Users/aaronccwong/Library/Developer/Xcode/DerivedData/project-fktsrvjheewrtvgfacyjdvcmdwnu/Build/Products/Debug-iphoneos/Ziggeo.framework/Ziggeo) built for iOS Simulator, file '/Users/aaronccwong/Library/Developer/Xcode/DerivedData/project-fktsrvjheewrtvgfacyjdvcmdwnu/Build/Products/Debug-iphoneos/Ziggeo.framework/Ziggeo' for architecture arm64

How can I fix this?

Bane-D commented 3 years ago

Based on the error you have downloaded the following framework: https://github.com/Ziggeo/iOS-Client-SDK/tree/master/Ziggeo/Output/Ziggeo.xcframework/ios-arm64_i386_x86_64-simulator/Ziggeo.framework

What you want for store is to use the non simulator framework: https://github.com/Ziggeo/iOS-Client-SDK/tree/master/Ziggeo/Output/Ziggeo.xcframework/ios-arm64_armv7/Ziggeo.framework

You can always find the available frameworks in the output directory https://github.com/Ziggeo/iOS-Client-SDK/tree/master/Ziggeo/Output

After replacing the files, you might need to also check your embedded and linked frameworks at the project settings to ensure this is loaded. You might also need to clean the project before you are able to build it again.

If that is the case the following codes should work:

$ cd ios
$ rm -rf build
$ xcodebuild clean
3akat commented 2 years ago

Closing the issue. @AaronCCWong, please reopen if you need more help here.