#benstjohn - ios SDK build issues

1 messages · Page 1 of 1 (latest)

astral jewelBOT
cedar musk
#

Hi, taking a look here.

west socket
#

Can you give us some more detail here @supple totem ?

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

west socket
#

What version of stripe-ios are you using?

supple totem
#

Where do I find that?

#

I just installed from cocoapods

#

I'm running Xcode 14

#

on an M2 macbook pro

west socket
#

Podfile.lock should have information about the version

supple totem
#
  • 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?

west socket
#

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?

supple totem
#

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

west socket
#

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?

supple totem
#

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

west socket
#

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?

supple totem
#

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)

west socket
#

Gotcha - and let's focus on your own project for now and ignore the UI examples since they're built/setup so differently

supple totem
#

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

west socket
#

Your project is now using 23.0 right?

supple totem
#

yes

#

and pod verison 1.11.3

west socket
#

Have you tried building this on a real device and not the simulator? Do you get the same results?

supple totem
#

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

west socket
supple totem
#

Where do I put that?

#

very bottom of the podfile?

west socket
#

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

supple totem
#

That solution gives you more issues if you have an M1 chip btw

#

that workaround

west socket
#

Can you try they following: pod deintegrate; pod install

supple totem
#

Okay just did that

west socket
#

and now try a clean build

supple totem
#

Doing a clean

#

still getting this error

#

this should give some more info

west socket
#

In your Build Settings do you see any excluded architectures?

supple totem
#

this solved it

#

so here was my solutions:

#
  1. Building for a DEVICE rather than a simulator (gave me more specific build erros)
#
  1. Signing each pod
#
  1. Removing all of the excluded architecture which was added per all of the OTHER stack overflow articles lol
west socket
#

hurray! i'm glad that worked

supple totem
#

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

west socket
#

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

supple totem
#

yeah it's pretty bad right now

west socket
#

I need to head out, but if you need anything else @visual ravine can help

supple totem
#

Thanks!

#

@visual ravine I should be all set now! Thanks...

visual ravine
#

Great to hear!

supple totem
#

@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 ...

▶ Play video
#

in the init

#

I'm just hardcoding the key for testing sake though

#

do I need to add the Stripe pods in here?

visual ravine
#

I don't think any of that should be necessary, it should all work with the build step as is

supple totem
visual ravine
#

Actually since cleaning up those excluded architectures, have you re-run the clean & pod install?

supple totem
#

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

visual ravine
#

Wow that's bizarrely specific

supple totem
#

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

visual ravine
#

Make sure its the publishable key (pk_test_123)

supple totem
#

gotcha

#

so sk_ isn't what I'm looking for

visual ravine
#

No, thats your secret key

supple totem
#

what's the pk for?

visual ravine
#

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

supple totem
#

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?

visual ravine
#

Correct, though a redacted version of the PI can be retrieved with the PK

supple totem
#

so I can still fulfill payment intents on IOS as long as I have the server pass in the clientSecret to ios?

visual ravine
#

Exactly (same is true on web)

supple totem
#

Awesome! Thanks again for your help

visual ravine
supple totem
#

Do I create the ephemeral key?

#

I is it auto generated?

visual ravine
#

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.

supple totem
#

Okay perfect!

visual ravine
#

benstjohn - ios SDK build issues