tolu360 / cordova-plugin-paystack

This plugin allows to add Paystack Payments to your application using Paystack Native Mobile SDKs for Android & iOS
Other
34 stars 16 forks source link

Archiving iOS app for distribution fails #29

Open mykoman opened 5 years ago

mykoman commented 5 years ago

Hello Tolu,

Well done for this plugin . The plugin worked well on simulators but when I tried to build my product for production on iOS it gives me this error.

ld: warning: ignoring file Stash.ng/Plugins/cordova-plugin-paystack/Paystack.framework/Paystack, file was built for x86_64 which is not the architecture being linked (armv7): Stash.ng/Plugins/cordova-plugin-paystack/Paystack.framework/Paystack Undefined symbols for architecture armv7: "_OBJCCLASS$_PSTCKTransactionParams", referenced from: objc-class-ref in PaystackPlugin.o "_OBJCCLASS$_PSTCKAPIClient", referenced from: objc-class-ref in PaystackPlugin.o "_OBJCCLASS$_PSTCKCardParams", referenced from: objc-class-ref in PaystackPlugin.o "_OBJCCLASS$_PSTCKCardValidator", referenced from: objc-class-ref in PaystackPlugin.o "_OBJCCLASS$_Paystack", referenced from: objc-class-ref in PaystackPlugin.o (maybe you meant: _OBJCCLASS$_PaystackPlugin) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Kindly help look into this.

Thanks

steveamaza commented 5 years ago

Hi @tolu360 any idea why this error is happening?

steveamaza commented 5 years ago

Hi @mykoman, I am not very familiar with the Cordova plugin but from using the React Native plugin, it does not seem this is an error from this library but a general error.

Please look through https://stackoverflow.com/a/22336755/4384105 and see if this can help

tolu360 commented 5 years ago

Hi @mykoman & @steveamaza, so sorry for not being able to respond to you on time, been quite busy!

So I am not sure what is happening but I have a theory or explanation for you as regards the error - the simulators are often running on i386 and x86_64 architectures, while physical devices usually run on arm64, armv7, armv7s etc, architectures such that libraries and frameworks often carry their debug build settings to release builds and can result in build errors like yours.

A workaround might be to build your release for all architectures by setting Build Active Architecture Only to No for Release and adding arm64, arm64e, armv7 and armv7s to Valid Architectures under Build Settings.

Clean and rebuild your project after making the changes. Lets see how far that gets us!

mykoman commented 5 years ago

ios error

Thank you for your responses @steveamaza and @tolu360. I however have carried the instructions but the bug still persists.

I have also put up the picture showing how I implemented the changes you recommended. I will appreciate if you check the picture just to be sure I have done the required.

Thanks

tolu360 commented 5 years ago

Hi! It looks to me that you made the right changes, going by the screenshot.

I would find time to take a second look at this issue but in the meantime, try to remove/uninstall the plugin and reinstall, also ensure you are using the latest release of the Paystack framework by replacing the Paystack.framework file found at ~PROJECT_FOLDER/platforms/ios/PROJECT_ID/Plugins/cordova-plugin-paystack with a clean copy from https://github.com/PaystackHQ/paystack-ios/releases/

mykoman commented 5 years ago

Hello @tolu360 , Thank you for your commitment towards this. I have followed the recommendation here but the error still persist please. Thank you

mykoman commented 5 years ago

Hi @tolu360 ,

I hope you haven't given up on me. I am still waiting for you please. @steveamaza your help will be appreciated as well.

Thanks