#benstjohn - ios SDK build issues
1 messages · Page 1 of 1 (latest)
Hi, taking a look here.
Can you give us some more detail here @supple totem ?
I even tried on the UIExamples from Stripe and getting the same thing
the pods/dependencies are THERE but I'm getting this "no such module" stripe
What version of stripe-ios are you using?
Where do I find that?
I just installed from cocoapods
I'm running Xcode 14
on an M2 macbook pro
Podfile.lock should have information about the version
- Stripe (22.8.4):
- Stripe/Stripe3DS2 (= 22.8.4)
- StripeApplePay (= 22.8.4)
- StripeCore (= 22.8.4)
- StripeUICore (= 22.8.4)
- Stripe/Stripe3DS2 (22.8.4):
- StripeApplePay (= 22.8.4)
- StripeCore (= 22.8.4)
- StripeUICore (= 22.8.4)
- StripeApplePay (22.8.4):
- StripeCore (= 22.8.4)
- StripeCore (22.8.4)
- StripeUICore (22.8.4):
- StripeCore (= 22.8.4)
Just noticed that I need to target ios 13 rather than 12. Testing that out really quick
going to uninstall pods and reinstall after a cleanup
getting all v23 of everything with that
@west socket okay I just updated everything and still getting issues
this is my podfile
Would you recommend doing this with Swift Package Manager instead?
Okay let's back up for a minute - the screenshots you have are from the UI examples that we provide. Are you making sure to open stripe-ios/Stripe.xcworkspace from the root directory and then building UI examples from there?
yes
I'm using the workspace, not the .xcodeproj
This is being replicated for both the UI example as well as my personal project
the podfile is for my personal project
The UI example doesn't even have pods
If you're building from the root directory, why don't your screenshots have any of the other example apps in the sidebar? Are you sure you're not building from the UI example incorrectly?
But for my actual project this is what it looks like
same issue
platform :ios, '13.0' for the podfile
all pods are 23.0
There isn't any documentation on Stripes site of how to actually add the SDK into Xcode other than cocoapods which doesn't work on the new M1 and M2 macbook pros
other than cocoapods which doesn't work on the new M1 and M2 macbook pro -> can you elaborate on this a bit, I don't have an M1/M2 myself yet so I can't test but if cocoapods don't work with the new M1/M2 how did you install your dependencies?
So I had to do this: https://stackoverflow.com/a/65334677
so I'm using homebrew, and with the arch64 tag , I'm successfully installing the pods (some Cocoapods SEEMS like it is working, but it's not recognizing it as a module)
Gotcha - and let's focus on your own project for now and ignore the UI examples since they're built/setup so differently
okay
so for MY project, the above details are what is happening
I just was stating that the UI example also had the same issue so it's not a misconfig
Your project is now using 23.0 right?
Have you tried building this on a real device and not the simulator? Do you get the same results?
yeah
but it does give me some more information
do I have to sign all of the cocoapods?
So I signed them all, and now I'm getting this on build:
error build: Command PhaseScriptExecution failed with a nonzero exit code
Looks like that's a cocoapods issue - try doing the workaround suggested here: https://github.com/stripe/stripe-ios/issues/2012
Yeah you'd put it in your podfile - but if you've already signed them all you can worry about that later
Let me see what I can find for that new error
Can you try they following: pod deintegrate; pod install
Okay just did that
and now try a clean build
Doing a clean
still getting this error
this should give some more info
In your Build Settings do you see any excluded architectures?
this solved it
so here was my solutions:
- Building for a DEVICE rather than a simulator (gave me more specific build erros)
- Signing each pod
- Removing all of the excluded architecture which was added per all of the OTHER stack overflow articles lol
hurray! i'm glad that worked
Thanks!
Any idea if Apple is planning to fix all of this architecture crap with M1/M2?
and is there a simpler way to add packages for Stripe other than using Cocoapods? I see SPM, not sure if that's commonly supported though
ios is not my strong suit, so I'm not sure which is the best option - personally, I use cocoapods but if it's this much trouble with the M1/M2 I may need to switch to something else
yeah it's pretty bad right now
I need to head out, but if you need anything else @visual ravine can help
Great to hear!
@visual ravine actually I am getting one issue
so it's building fine, but as soon as I hit the page that calls Stripe - it's failing
dyld[11883]: Library not loaded: @rpath/Stripe.framework/Stripe
Referenced from: <6D540458-0D6F-3FA4-BC70-FBD7B7A76016> /private/var/containers/Bundle/Application/C56CFF77-4F0C-4D12-B561-AD4320796B37/ios-terminal-app.app/ios-terminal-app
Reason: tried: '/private/var/containers/Bundle/Application/C56CFF77-4F0C-4D12-B561-AD4320796B37/Frameworks/Stripe.framework/Stripe' (errno=2), '/private/var/containers/Bundle/Application/C56CFF77-4F0C-4D12-B561-AD4320796B37/Frameworks/Stripe.framework/Stripe' (errno=2), '/private/preboot/Cryptexes/OS@rpath/Stripe.framework/Stripe' (errno=2),
'/private/var/containers/Bundle/Application/C56CFF77-4F0C-4D12-B561-AD4320796B37/Frameworks/Stripe.framework/Stripe' (errno=2), '/private/var/containers/Bundle/Application/C56CFF77-4F0C-4D12-B561-AD4320796B37/Frameworks/Stripe.framework/Stripe' (errno=2), '/System/Library/Frameworks/Stripe.framework/Stripe' (errno=2, not in dyld cache)
Library not loaded: @rpath/Stripe.framework/Stripe
Referenced from: <6D540458-0D6F-3FA4-BC70-FBD7B7A76016> /private/var/containers/Bundle/Application/C56CFF77-4F0C-4D12-B561-AD4320796B37/ios-terminal-app.app/ios-terminal-app
Reason: tried: '/private/var/containers/Bundle/Application/C56CFF77-4F0C-4D12-B561-AD4320796B37/Frameworks/Stripe.framework/Stripe' (errno=2), '/private/var/containers/Bundle/Application/C56CFF77-4F0C-4D12-B561-AD4320796B37/Frameworks/Stripe.framework/Stripe' (errno=2), '/private/preboot/Cryptexes/OS@rpath/Stripe.framework/Stripe' (errno=2), '/private/var/containers/Bundle/Application/C56CFF77-4F0C-4D12-B561-AD4320796B37/Frameworks/Stripe.framework/Stripe' (errno=2), '/private/var/containers/Bundle/Application/C56CFF77-4F0C-4D12-B561-AD4320796B37/Frameworks/Stripe.framework/Stripe' (errno=2), '/System/Library/Frameworks/Stripe.framework/Stripe' (errno=2, not in dyld cache)
dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
(lldb)
All I'm doing is on the landing page calling init(){StripeAPI} as seen here: https://www.youtube.com/watch?v=okrl9CTYZI4&list=PLy1nL-pvL2M6yD1D72ceqqrW_1BqyN4It&index=1
In this episode, you'll learn how to get started with the stripe-ios client library and how to add Stripe to your iOS application. Thor covers installation of the library and how to make a request to fetch the publishable key from a server.
CocoaPods Installation: https://guides.cocoapods.org/using/getting-started.html#installation
Table ...
in the init
I'm just hardcoding the key for testing sake though
do I need to add the Stripe pods in here?
I don't think any of that should be necessary, it should all work with the build step as is
Actually since cleaning up those excluded architectures, have you re-run the clean & pod install?
let me try that real quick
pod clean?
okay just cleaned/installed
getting the same error
looking into this
Okay that worked
so my last question before I'm done here
Wow that's bizarrely specific
for the "StripeAPI.defaultPublishableKey " can I just set that to my API Key (testing) for Stripe?
haha IKR!
thank God for stack overflow
but yeah, idk why that happened
Make sure its the publishable key (pk_test_123)
No, thats your secret key
what's the pk for?
For client side operations
Since it is not secure from inspection
The secret key is to be used in your secure server side environment only
gotcha, so is that why the ios SDK doesn't allow you to retrieve the paymentintent without the client secret? Because it doesn't have the same permissions as Secret Key?
Correct, though a redacted version of the PI can be retrieved with the PK
so I can still fulfill payment intents on IOS as long as I have the server pass in the clientSecret to ios?
Exactly (same is true on web)
Awesome! Thanks again for your help
On IOS you have the additional optional path of ephemeral keys when savings or re-using cards on a customer:
https://stripe.com/docs/payments/accept-a-payment?platform=ios&ui=payment-sheet#add-server-endpoint
If you need it (as covered in the doc)
No, your server generates these if your flows require it
If you never save cards to a Customer and don’t allow returning Customers to reuse saved cards, you can omit the Customer and Customer Ephemeral Key objects from your integration.
Okay perfect!
benstjohn - ios SDK build issues