zyra / cordova-plugin-stripe

A Cordova plugin that lets you use Stripe's Native SDKs for Android and iOS.
MIT License
93 stars 57 forks source link

IOS integration #1

Closed ilhanaydinli closed 7 years ago

ilhanaydinli commented 7 years ago

Hi, We use your repository in your application. No problems on Android. But when we compile the application on iOS, we get the following error.

/mobil/platforms/ios/Cabway/Plugins/cordova-plugin-stripe/CordovaStripe.m:2:9: fatal error: 
      module 'Stripe' not found
@import Stripe;
 ~~~~~~~^~~~~~
1 error generated.

** BUILD FAILED **

The following build commands failed:
    CompileC /Library/Developer/Xcode/DerivedData/Cabway-eclvhvcozufbgaglruiycvfuycfq/Build/Intermediates/Cabway.build/Debug-iphonesimulator/Cabway.build/Objects-normal/x86_64/CordovaStripe.o Cabway/Plugins/cordova-plugin-stripe/CordovaStripe.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/mobil/platforms/ios/cordova/build-debug.xcconfig,-workspace,Cabway.xcworkspace,-scheme,Cabway,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone 5s,build,CONFIGURATION_BUILD_DIR=/mobil/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/mobil/platforms/ios/build/sharedpch
ihadeed commented 7 years ago

@ilhanaydinli this issue happens when you install the plugin via NPM, I will look into it and fix it ASAP.

For now this seems to be working fine:

cordova plugin add https://github.com/zyramedia/cordova-plugin-stripe
ilhanaydinli commented 7 years ago

@ihadeed I did what you said, but nothing changed. He gave the same error. I found a solution like this. mobil\plugins\cordova-plugin-stripe\cordova-plugin-stripe\src\ios\Stripe.framework\Versions\A I carried the files in this directory to the following directory. mobil\plugins\cordova-plugin-stripe\cordova-plugin-stripe\src\ios\Stripe.framework

I did the same thing on the iOS platform. mobil\platforms\ios\Cabway\Plugins\cordova-plugin-stripe\cordova-plugin-stripe\src\ios\Stripe.framework\Versions\A From here to here. mobil\platforms\ios\Cabway\Plugins\cordova-plugin-stripe\cordova-plugin-stripe\src\ios\Stripe.framework

It was compiled without problems. However, xcode has warned that some stripe files are missing. I think the problem is caused by the inability to read the file mobile\platforms\ios\Cabway\Plugins\cordova-plugin-stripe\cordova-plugin-stripe\src\ios\Stripe.framework\Headers.

I already found the directory path that I changed in the Headers file. But he can not read it. That's the problem.

ihadeed commented 7 years ago

@ilhanaydinli did you remove the plugin first before running the command above?

And thanks for your feedback, I'll try what you mentioned and see if I can fix this.

ilhanaydinli commented 7 years ago

@ihadeed When you remove it and load it again as you say, there is no problem. My work was based on the old installation method. If you remove the plugin and add it again as you say, there is no problem. Thank you very much for your help.

ihadeed commented 7 years ago

@ilhanaydinli Thanks for your feedback.

The issue happens after I run npm publish or npm pack (to publish the plugin to npm)... compressing the project is breaking the Stripe framework.

ilhanaydinli commented 7 years ago

@ihadeed I thank you for your help.

ihadeed commented 7 years ago

@ilhanaydinli FYI you can install the plugin from npm now without problems.