Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error build after update Xcode. #1183

Closed
ameerarx opened this issue Oct 26, 2022 · 20 comments
Closed

Error build after update Xcode. #1183

ameerarx opened this issue Oct 26, 2022 · 20 comments

Comments

@ameerarx
Copy link

ameerarx commented Oct 26, 2022

Describe the bug
error build: '(any PKPaymentAuthorizationControllerDelegate) -> ((PKPaymentAuthorizationController, PKShippingMethod, @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) -> Void)?' is not convertible to 'pkDidSelectShippingMethodSignature' (aka 'Optional<((any PKPaymentAuthorizationControllerDelegate) -> (PKPaymentAuthorizationController, PKShippingMethod, @escaping (PKPaymentRequestShippingMethodUpdate) -> ()) -> ())>')
Did you mean to use 'as!' to force downcast?

Expected behavior
A bug appeared after updating Xcode. The project does not start.

Screenshots
telegram-cloud-photo-size-2-5388614232288903119-y
image

Desktop (please complete the following information):

  • Xcode 14.0.1
  • Iphone 14 Pro Max (Simulator)
  • React Native 0.67.2
  • @stripe/stripe-react-native "^0.7.0"
@hasbund
Copy link

hasbund commented Oct 26, 2022

Been having same issue for about a week now. Using Expo 46 currently and have tried on 45 and 44 with correct dependencies and same issue persists.

The best I can tell from my research is it seems to be a problem with iOS 16. In my own case I ran my app with iOS 15 and it worked perfectly. Then I updated iphone to iOS 16 which forced xCode update to xCode 14 before it would connect. That's when I started getting the same error that you're getting and have been stuck for a week. Still haven't figured out a fix but thought I'd throw this on the pile of info in case anyone more experienced than I can tell what's going on. It's definitely something between iOS 16 and xCode 14 that's causing the problem, as best as I can tell.

@cebrakadabra
Copy link

Screenshot 2022-10-27 at 7 51 13 PM

I just ran into the exact same issue. I can confirm it is independent from the stripe version, as I played around with running 0.18.1 all the way down to 0.6.1. It must have to do something with iOS16 and xCode14 (just upgraded yesterday) - no issues on Android on the same machine (Apple M1) for anything under 0.8.x

Xcode 14.0.1
Iphone 14 Pro Max (Simulator)
React Native 0.64.1
@stripe/stripe-react-native "^0.6.1"

@cebrakadabra
Copy link

stripe/stripe-ios#1973

@adnandothussain
Copy link

Any updates on this issue?

@cebrakadabra
Copy link

I was able to resolve that issue myself by upgrading to the following in my package.json:

    ...
    "@stripe/stripe-react-native": "0.19.0"
    ...
    "expo": ">=47.0.0-0 <48.0.0",
    ...
    "react": "18.1.0",
    "react-native": "0.70.4",
    ...

@wassimAJ
Copy link

wassimAJ commented Nov 2, 2022

Upgrading to @stripe/stripe-react-native 0.19.0 then in the ios files running "pod update Stripe" solved my issue.

@Joshmatjjen
Copy link

Upgrading to version 0.19.0 did not fixed the error

@Ashishpal438
Copy link

Upgrading to @stripe/stripe-react-native 0.19.0 then in the ios files running "pod update Stripe" solved my issue.
Thanks Man @wassimAJ This worked for me

xcode 14.1
react-native 0.64.1

@wassimAJ
Copy link

Upgrading to version 0.19.0 did not fixed the error

What react version are you using?
and did you run pod update Stripe after it?

@ameerarx
Copy link
Author

Screenshot 2022-10-27 at 7 51 13 PM

I just ran into the exact same issue. I can confirm it is independent from the stripe version, as I played around with running 0.18.1 all the way down to 0.6.1. It must have to do something with iOS16 and xCode14 (just upgraded yesterday) - no issues on Android on the same machine (Apple M1) for anything under 0.8.x

Xcode 14.0.1 Iphone 14 Pro Max (Simulator) React Native 0.64.1 @stripe/stripe-react-native "^0.6.1"

I updated the stripe to the latest version and solved the problem on iOS

@ameerarx
Copy link
Author

Any updates on this issue?

I updated the stripe to the latest version and solved the problem on iOS

@Joshmatjjen
Copy link

Joshmatjjen commented Nov 16, 2022

Any updates on this issue?

I updated the stripe to the latest version and solved the problem on iOS

@ameerarx Please Can you show use your package.json dependency
Let's see your version
And which version of expo-cli are you using

@ameerarx
Copy link
Author

Any updates on this issue?

I updated the stripe to the latest version and solved the problem on iOS

@ameerarx Please Can you show use your package.json dependency Let's see your version And which version of expo-cli are you using

"@stripe/stripe-react-native": "^0.19.0",
"react-native": "0.67.2",

@charliecruzan-stripe
Copy link
Collaborator

This is fixed in the most recent version (provided you run pod install after upgrading)- if you're using expo, make sure you are on the most recent SDK and are installing with expo install @stripe/stripe-react-native. That should install 0.19.0 if you're on SDK 47.

@antoinerousseau
Copy link

I'm using stripe-react-native 0.23.1 and still getting this error under RN 0.70 or RN 0.71...

The following build commands failed:
SwiftEmitModule normal x86_64 Emitting\ module\ for\ StripePayments (in target 'StripePayments' from project 'Pods')
SwiftCompile normal x86_64 Compiling\ [...] (in target 'StripePayments' from project 'Pods')

Any clue?

Xcode 14.2 on M2 Pro

@PedroDmian
Copy link

I'm using stripe-react-native 0.23.1 and still getting this error under RN 0.70 or RN 0.71...

The following build commands failed:
SwiftEmitModule normal x86_64 Emitting\ module\ for\ StripePayments (in target 'StripePayments' from project 'Pods')
SwiftCompile normal x86_64 Compiling\ [...] (in target 'StripePayments' from project 'Pods')

Any clue?

Xcode 14.2 on M2 Pro

I solved it as follows

My computer is a

M1, Xcode 14.2

package.json
...
"@stripe/stripe-react-native": "^0.2.3" 🆙 👉🏻 "@stripe/stripe-react-native": "0.23.3"
...
"react": "17.0.2", (remained unchanged)
"react-native": "0.66.0", (remained unchanged)
...

I update my PodFile https://stackoverflow.com/a/74192042/6080699
...
platform :ios, '11.0' to platform :ios, '13.0'

And added these lines

installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
          target.build_configurations.each do |config|
              config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
          end
        end
      end
    end
  end

Delete

  • node_modules
  • package-lock.json
  • Podfile.lock
  • Pods

reinstall

I hope it will be useful to someone

@antoinerousseau
Copy link

I don't think turning off code signing has to do with this but anyway I ended up building through Rosetta 2 and it worked.

@Hopefulee
Copy link

Hopefulee commented Feb 22, 2023

@antoinerousseau - hi how did you get it work?

I am getting errors with M1

LoadError - dlopen(/Users/blackbee/Projects/<project>/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.5/lib/ffi_c.bundle, 0x0009): tried: '/Users/blackbee/Projects/<project>/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.5/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /Users/blackbee/Pr<project>/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.5/lib/ffi_c.bundle
"react": "18.1.0",
"react-native": "0.70.6",
"@stripe/stripe-react-native": "^0.24.0",

@antoinerousseau
Copy link

@Hopefulee make sure you open Xcode through Rosetta 2 (or run yarn ios in a Rosetta 2 terminal)

Also check your Ruby version (I use RVM), clean the build folder, pod install etc

@pkalani1999
Copy link

@antoinerousseau - hi how did you get it work?

I am getting errors with M1

LoadError - dlopen(/Users/blackbee/Projects/<project>/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.5/lib/ffi_c.bundle, 0x0009): tried: '/Users/blackbee/Projects/<project>/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.5/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /Users/blackbee/Pr<project>/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.5/lib/ffi_c.bundle
"react": "18.1.0",
"react-native": "0.70.6",
"@stripe/stripe-react-native": "^0.24.0",

same issue in IOS xcode 15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests