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

fatal error: 'Paystack/Paystack.h' file not found #1

Closed dayaki closed 8 years ago

dayaki commented 8 years ago

Am trying to use your plugin for ionic 2, but am getting this error when i try to build for ios ` In file included from /Users/SpryPixels/Apps/realmv2/platforms/ios/ROG/Plugins/cordova-plugin-paystack/PaystackPlugin.m:3: ROG/Plugins/cordova-plugin-paystack/PaystackPlugin.h:4:9: fatal error: 'Paystack/Paystack.h' file not found

import <Paystack/Paystack.h>

`

tolu360 commented 8 years ago

Hello @dayaki - from the error you quoted above, it'd seem XCode cannot find the Paystack Framework. I would suggest you try the following to debug/resolve the issues you are experiencing:

  1. Check to ensure you are on the most recent version of the plugin (>= 1.1.0).
  2. Manually inspect that XCode has indeed pulled the plugin in correctly, see the screenshots below:
screen shot 2016-05-12 at 3 49 55 pm screen shot 2016-05-12 at 3 51 37 pm

Ensure your project is selected under Targets in XCode and switch to the Build Phases tab to inspect Compile Sources and Link Binary With Libraries. Similarly switch to the Build Settings tab to inspect that the path to the plugin is referenced in Framework Search Paths.

XCode should just get these settings correctly when you installed the plugin but sometimes it does not.

If none of the steps above resolved your issues, please consider deleting the plugin from your project (ionic plugin rm cordova-plugin-paystack or cordova plugin rm cordova-plugin-paystack) and pulling it in afresh. Happy hacking!

dayaki commented 8 years ago

This is my own version:

screen-shot-2016-05-12-at-6 29 30-pm screen-shot-2016-05-12-at-6 30 07-pm screen-shot-2016-05-12-at-6 30 02-pm

this this the right path to Paystack.h?

#import <Paystack/Paystack.h>

I tried removing and reinstalling the plugin, same error

tolu360 commented 8 years ago

The attached look good to me. A bit under the weather now but I'd review and see if I can reproduce your issue and then get back to you.

Cheers. On May 12, 2016 6:35 PM, "Dayo Akinkuowo" notifications@github.com wrote:

This is my own version:

[image: screen-shot-2016-05-12-at-6 29 30-pm] https://cloud.githubusercontent.com/assets/815619/15224226/0aea07ca-1870-11e6-8f65-81bed90f4b89.jpg [image: screen-shot-2016-05-12-at-6 30 07-pm] https://cloud.githubusercontent.com/assets/815619/15224228/10d8be1a-1870-11e6-9727-99bdfef7c730.jpg [image: screen-shot-2016-05-12-at-6 30 02-pm] https://cloud.githubusercontent.com/assets/815619/15224234/13348310-1870-11e6-93f4-69e422ee9d14.jpg

this this the right path to Paystack.h?

import <Paystack/Paystack.h>

I tried removing and reinstalling the plugin, same error

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/tolu360/Cordova-Plugin-Paystack/issues/1#issuecomment-218829845

dayaki commented 8 years ago

Oh sorry, get well soon. Take your time, am in no worry

tolu360 commented 8 years ago

I have now been able to reproduce the issue, it appears to be related to either changes in new versions of Cordova (v6.1.1) or XCode (v7.3.1) - I haven't been able to isolate which is breaking the build but I'm on it. Kindly drop your versions below, that should help. Thanks

dayaki commented 8 years ago

Thanks for looking into this, hope you better now.

Cordova - v6.1.1 XCode - v7.3.1 Ionic - v2.0.0-beta.2

tolu360 commented 8 years ago

I am much better, thanks for asking. The issue is definitely related to the upgrades! Will figure it out. On May 18, 2016 11:58 AM, "Dayo Akinkuowo" notifications@github.com wrote:

Thanks for looking into this, hope you better now.

Cordova - v6.1.1 XCode - v7.3.1 Ionic - v2.0.0-beta.2

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/tolu360/Cordova-Plugin-Paystack/issues/1#issuecomment-219993104

tolu360 commented 8 years ago

Hi @dayaki, seems I was wrong about the true cause of the issue, turns out it's not so much about XCode but Github/NPM. Try the following and revert:

  1. Remove the plugin from your app ($ cordova plugin rm cordova-plugin-paystack) or ($ionic plugin rm cordova-plugin-paystack) - either command is fine, exit XCode if previously opened.
  2. Add back the plugin by pulling directly from the repo ($ ionic plugin add https://github.com/tolu360/Cordova-Plugin-Paystack) or ($ cordova plugin add https://github.com/tolu360/Cordova-Plugin-Paystack).
  3. Build your project again ($ ionic build ios).
  4. Run your app in XCode or via the cli.
tolu360 commented 8 years ago

Hello @dayaki, was kind of waiting on your feedback to know if this work-around actually works or not - you might want to give it a try when you can. Thanks

dayaki commented 8 years ago

sorry for my late reply. Everything working now

tolu360 commented 8 years ago

Thanks for confirming that installing directly from the repo fixes the build error. I have now added a detailed work-around section to the README to help others and with this I'm closing this issue - thanks for reporting this and working with me to fix it.