skip to Main Content

I’ve just changed to a new MacBook Pro with the M1 chip and I can’t build my app on Xcode. I’ve already updated all cocoaPods and have already installed the sudo gem cocoa pods install command in the terminal with Rosetta. These are the two errors I get and make the build Fail:

'new' is unavailable: You cannot directly instantiate an STPIssuingCardPin

7

Answers


  1. Chosen as BEST ANSWER

    I just had to change the pod... I had it to a previous version. So specifically check out which version you have in your podfile.

    pod 'Stripe', '~> 21.4'
    

  2. As it stands in April, 2021…

    TL;DR

    This is happening since Xcode 12.5, fixed in Stripe 21.3.1, backported to 19.4.1, 17.0.3, 15.0.2, and 14.0.1, according to Pull Request #1766 ‘Fix compatibility with Xcode 12.5’, so the solution for most will be to upgrade Stripe to 21.3.1 or above.

    Downgrade Xcode

    The simplest alternative, of course, if you need this urgently and want a quick and dirty method, is to downgrade to Xcode 12.4. If you just went ahead and upgraded, like I did, not knowing the potential consequences, you can go to Apple’s Download ‘more’ section and get it from there.

    Cocoapods

    For those of you who are using Cocoapods (eg. React Native starting version 0.60): note that, with the exception of 21.3.1, none of the other Stripe versions listed above appear to be available on Stripe’s Cocoapods changelog page, and, according to Issue #1767 ‘ver 19.4.1 is still missing from Cocoapods and How about 20.1.2?’, it appears they won’t be, at least not 19.4.1, which is what I needed, as upgrading Stripe above version 19 caused errors with tipsi-stripe, the library I used to implement card payment in my React Native app.

    Stripe’s up-and-coming RN library

    As a side note, Stripe is about to release its React Native (RN) library, and I have signed up to be a collaborator in its private beta progam, reporting smaller cosmetic bugs mainly. It’s already so close to completion, that I could successfully replace tipsi-stripe with it. The Stripe version used in the new library is above the latest fix version, so this error is not appearing there anymore.

    Edit May 2021

    Stripe’s RN library is now in public beta; you might want to give it a try: https://github.com/stripe/stripe-react-native

    Login or Signup to reply.
  3. Step 1: Install latest version of tipsi-stripe package

    "tipsi-stripe": "^9.0.0"
    

    Step 2: Update version Stripe in podfile

    pod 'Stripe', '21.4.0'
    

    Step 3: Update platform in podfile and

    platform :ios, '11.0'
    pod install --repo-update
    

    Step 4: In xcode project -- > Info --> Deployment Target

    iOS Deployment Target change to '11.0'
    

    Step 5: Add Empty swift file to your project in Xcode. For example File.swift, after that you should accept modal to create bridge.

    step 6: Remove ""$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"", line from LIBRARY_SEARCH_PATHS in project.pbxproj file.

    Login or Signup to reply.
  4. I ran pod update Stripe in the ios folder of my react native project and that resolved the issue by upgrading the Stripe pod from 19.4.0 to 19.4.1.

    Login or Signup to reply.
  5. Looks like your local copy of the specs repo hasn’t been updated in a while. Try running

    pod repo update

    then change your stripe version to

    pod 'Stripe', '~> 21.4'
    

    then pod install

    Login or Signup to reply.
  6. Seems to be some stuff related with payment SDK’s. If you came here and you are using Paystack you might want to update your Paystack version.

    pod 'Paystack', '~> 3.0.16'
    
    Login or Signup to reply.
  7. I was facing a similar issue with stripe pods. My project stopped working when my Xcode updated to 12.5. After a lot of struggle I came up with a simple solution.

    1. Comment the stripe pods. // pod ‘Stripe’
    2. Run pod install. This will remove existing stripe pods.
    3. Uncomment stripe pods again. pod ‘Stripe’
    4. Run pod install. This will install latest version of stripe pods.

    I had to follow this approach since pod update, pod repo update failed endlessly with my project.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search