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: 'new' is unavailable: You cannot directly instantiate an STPIssuingCardPin #246

Open
josh-burton opened this issue Feb 4, 2021 · 26 comments

Comments

@josh-burton
Copy link

I'm suddenly encountering ios build issues which looks like an compile time error in the stripe sdk:

Xcode's output:
↳
    /ios/Pods/Stripe/Stripe/STPPinManagementService.m:51:81: error: 'new' is unavailable: You cannot directly instantiate an STPIssuingCardPin
                                                    deserializer:[STPIssuingCardPin new]
                                                                                    ^
    In file included from /ios/Pods/Stripe/Stripe/STPPinManagementService.m:11:
    /ios/Pods/Stripe/Stripe/PublicHeaders/STPIssuingCardPin.h:22:1: note: 'init' has been explicitly marked unavailable here
    - (instancetype)init __attribute__((unavailable("You cannot directly instantiate an STPIssuingCardPin")));
    ^
    /ios/Pods/Stripe/Stripe/STPPinManagementService.m:101:81: error: 'new' is unavailable: You cannot directly instantiate an STPIssuingCardPin
                                                    deserializer:[STPIssuingCardPin new]
                                                                                    ^
    In file included from /ios/Pods/Stripe/Stripe/STPPinManagementService.m:11:
    /ios/Pods/Stripe/Stripe/PublicHeaders/STPIssuingCardPin.h:22:1: note: 'init' has been explicitly marked unavailable here
    - (instancetype)init __attribute__((unavailable("You cannot directly instantiate an STPIssuingCardPin")));

It seems like recent versions of this plugin fixed the version of the stripe SDK its using, but could this be from another transitive dependency?

@stephen-pace
Copy link

I'm having this issue now too. Were you able to fix it?

@josh-burton
Copy link
Author

It seems to randomly come and go for me and I can't figure out why.

@jonasbark
Copy link
Owner

I think it would be helpful if you could post the podfile.lock part from the iOS directory and specifically the stripe part - one might be able to figure out if it's a dependency issue

@stephen-pace
Copy link

here's the whole podfile.lock

PODS:

  • Branch (0.36.0)
  • camera (0.0.1):
    • Flutter
  • camera_with_rtmp (0.0.1):
    • Flutter
    • HaishinKit (~> 1.0.10)
  • contacts_service (0.2.2):
    • Flutter
  • device_info (0.0.1):
    • Flutter
  • Firebase/CoreOnly (6.33.0):
    • FirebaseCore (= 6.10.3)
  • Firebase/DynamicLinks (6.33.0):
    • Firebase/CoreOnly
    • FirebaseDynamicLinks (~> 4.3.1)
  • Firebase/Messaging (6.33.0):
    • Firebase/CoreOnly
    • FirebaseMessaging (~> 4.7.0)
  • firebase_core (0.5.3):
    • Firebase/CoreOnly (~> 6.33.0)
    • Flutter
  • firebase_dynamic_links (0.6.3):
    • Firebase/CoreOnly (~> 6.33.0)
    • Firebase/DynamicLinks (~> 6.33.0)
    • firebase_core
    • Flutter
  • firebase_messaging (7.0.3):
    • Firebase/CoreOnly (~> 6.33.0)
    • Firebase/Messaging (~> 6.33.0)
    • firebase_core
    • Flutter
  • FirebaseCore (6.10.3):
    • FirebaseCoreDiagnostics (~> 1.6)
    • GoogleUtilities/Environment (~> 6.7)
    • GoogleUtilities/Logger (~> 6.7)
  • FirebaseCoreDiagnostics (1.7.0):
    • GoogleDataTransport (~> 7.4)
    • GoogleUtilities/Environment (~> 6.7)
    • GoogleUtilities/Logger (~> 6.7)
    • nanopb (~> 1.30906.0)
  • FirebaseDynamicLinks (4.3.1):
    • FirebaseCore (~> 6.10)
  • FirebaseInstallations (1.7.0):
    • FirebaseCore (~> 6.10)
    • GoogleUtilities/Environment (~> 6.7)
    • GoogleUtilities/UserDefaults (~> 6.7)
    • PromisesObjC (~> 1.2)
  • FirebaseInstanceID (4.8.0):
    • FirebaseCore (~> 6.10)
    • FirebaseInstallations (~> 1.6)
    • GoogleUtilities/Environment (~> 6.7)
    • GoogleUtilities/UserDefaults (~> 6.7)
  • FirebaseMessaging (4.7.1):
    • FirebaseCore (~> 6.10)
    • FirebaseInstanceID (~> 4.7)
    • GoogleUtilities/AppDelegateSwizzler (~> 6.7)
    • GoogleUtilities/Environment (~> 6.7)
    • GoogleUtilities/Reachability (~> 6.7)
    • GoogleUtilities/UserDefaults (~> 6.7)
    • Protobuf (>= 3.9.2, ~> 3.9)
  • Flutter (1.0.0)
  • flutter_branch_sdk (1.3.2):
    • Branch (~> 0.36.0)
    • Flutter
  • flutter_ffmpeg (0.3.0):
    • Flutter
    • flutter_ffmpeg/https (= 0.3.0)
  • flutter_ffmpeg/https (0.3.0):
    • Flutter
    • mobile-ffmpeg-https (= 4.4)
  • flutter_local_notifications (0.0.1):
    • Flutter
  • flutter_secure_storage (3.3.1):
    • Flutter
  • gallery_saver (0.0.1):
    • Flutter
  • GoogleDataTransport (7.5.1):
    • nanopb (~> 1.30906.0)
  • GoogleUtilities/AppDelegateSwizzler (6.7.2):
    • GoogleUtilities/Environment
    • GoogleUtilities/Logger
    • GoogleUtilities/Network
  • GoogleUtilities/Environment (6.7.2):
    • PromisesObjC (~> 1.2)
  • GoogleUtilities/Logger (6.7.2):
    • GoogleUtilities/Environment
  • GoogleUtilities/Network (6.7.2):
    • GoogleUtilities/Logger
    • "GoogleUtilities/NSData+zlib"
    • GoogleUtilities/Reachability
  • "GoogleUtilities/NSData+zlib (6.7.2)"
  • GoogleUtilities/Reachability (6.7.2):
    • GoogleUtilities/Logger
  • GoogleUtilities/UserDefaults (6.7.2):
    • GoogleUtilities/Logger
  • HaishinKit (1.0.13):
    • Logboard (~> 2.1.3)
  • image_cropper (0.0.3):
    • Flutter
    • TOCropViewController (~> 2.5.4)
  • image_picker (0.0.1):
    • Flutter
  • libphonenumber (0.0.1):
    • Flutter
    • libPhoneNumber-iOS
  • libPhoneNumber-iOS (0.9.15)
  • Logboard (2.1.3)
  • mobile-ffmpeg-https (4.4)
  • nanopb (1.30906.0):
    • nanopb/decode (= 1.30906.0)
    • nanopb/encode (= 1.30906.0)
  • nanopb/decode (1.30906.0)
  • nanopb/encode (1.30906.0)
  • native_device_orientation (0.0.1):
    • Flutter
  • path_provider (0.0.1):
    • Flutter
  • "permission_handler (5.0.1+1)":
    • Flutter
  • PromisesObjC (1.2.12)
  • Protobuf (3.14.0)
  • share (0.0.1):
    • Flutter
  • share_extend (0.0.1):
    • Flutter
  • shared_preferences (0.0.1):
    • Flutter
  • Stripe (19.4.0)
  • stripe_payment (1.0.0):
    • Flutter
    • Stripe (>= 19.0.1)
  • TOCropViewController (2.5.5)
  • uni_links (0.0.1):
    • Flutter
  • url_launcher (0.0.1):
    • Flutter
  • video_player (0.0.1):
    • Flutter
  • wakelock (0.0.1):
    • Flutter

DEPENDENCIES:

  • Branch
  • camera (from .symlinks/plugins/camera/ios)
  • camera_with_rtmp (from .symlinks/plugins/camera_with_rtmp/ios)
  • contacts_service (from .symlinks/plugins/contacts_service/ios)
  • device_info (from .symlinks/plugins/device_info/ios)
  • firebase_core (from .symlinks/plugins/firebase_core/ios)
  • firebase_dynamic_links (from .symlinks/plugins/firebase_dynamic_links/ios)
  • firebase_messaging (from .symlinks/plugins/firebase_messaging/ios)
  • Flutter (from Flutter)
  • flutter_branch_sdk (from .symlinks/plugins/flutter_branch_sdk/ios)
  • flutter_ffmpeg (from .symlinks/plugins/flutter_ffmpeg/ios)
  • flutter_local_notifications (from .symlinks/plugins/flutter_local_notifications/ios)
  • flutter_secure_storage (from .symlinks/plugins/flutter_secure_storage/ios)
  • gallery_saver (from .symlinks/plugins/gallery_saver/ios)
  • image_cropper (from .symlinks/plugins/image_cropper/ios)
  • image_picker (from .symlinks/plugins/image_picker/ios)
  • libphonenumber (from .symlinks/plugins/libphonenumber/ios)
  • native_device_orientation (from .symlinks/plugins/native_device_orientation/ios)
  • path_provider (from .symlinks/plugins/path_provider/ios)
  • permission_handler (from .symlinks/plugins/permission_handler/ios)
  • share (from .symlinks/plugins/share/ios)
  • share_extend (from .symlinks/plugins/share_extend/ios)
  • shared_preferences (from .symlinks/plugins/shared_preferences/ios)
  • stripe_payment (from .symlinks/plugins/stripe_payment/ios)
  • uni_links (from .symlinks/plugins/uni_links/ios)
  • url_launcher (from .symlinks/plugins/url_launcher/ios)
  • video_player (from .symlinks/plugins/video_player/ios)
  • wakelock (from .symlinks/plugins/wakelock/ios)

SPEC REPOS:
trunk:
- Branch
- Firebase
- FirebaseCore
- FirebaseCoreDiagnostics
- FirebaseDynamicLinks
- FirebaseInstallations
- FirebaseInstanceID
- FirebaseMessaging
- GoogleDataTransport
- GoogleUtilities
- HaishinKit
- libPhoneNumber-iOS
- Logboard
- mobile-ffmpeg-https
- nanopb
- PromisesObjC
- Protobuf
- Stripe
- TOCropViewController

EXTERNAL SOURCES:
camera:
:path: ".symlinks/plugins/camera/ios"
camera_with_rtmp:
:path: ".symlinks/plugins/camera_with_rtmp/ios"
contacts_service:
:path: ".symlinks/plugins/contacts_service/ios"
device_info:
:path: ".symlinks/plugins/device_info/ios"
firebase_core:
:path: ".symlinks/plugins/firebase_core/ios"
firebase_dynamic_links:
:path: ".symlinks/plugins/firebase_dynamic_links/ios"
firebase_messaging:
:path: ".symlinks/plugins/firebase_messaging/ios"
Flutter:
:path: Flutter
flutter_branch_sdk:
:path: ".symlinks/plugins/flutter_branch_sdk/ios"
flutter_ffmpeg:
:path: ".symlinks/plugins/flutter_ffmpeg/ios"
flutter_local_notifications:
:path: ".symlinks/plugins/flutter_local_notifications/ios"
flutter_secure_storage:
:path: ".symlinks/plugins/flutter_secure_storage/ios"
gallery_saver:
:path: ".symlinks/plugins/gallery_saver/ios"
image_cropper:
:path: ".symlinks/plugins/image_cropper/ios"
image_picker:
:path: ".symlinks/plugins/image_picker/ios"
libphonenumber:
:path: ".symlinks/plugins/libphonenumber/ios"
native_device_orientation:
:path: ".symlinks/plugins/native_device_orientation/ios"
path_provider:
:path: ".symlinks/plugins/path_provider/ios"
permission_handler:
:path: ".symlinks/plugins/permission_handler/ios"
share:
:path: ".symlinks/plugins/share/ios"
share_extend:
:path: ".symlinks/plugins/share_extend/ios"
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
stripe_payment:
:path: ".symlinks/plugins/stripe_payment/ios"
uni_links:
:path: ".symlinks/plugins/uni_links/ios"
url_launcher:
:path: ".symlinks/plugins/url_launcher/ios"
video_player:
:path: ".symlinks/plugins/video_player/ios"
wakelock:
:path: ".symlinks/plugins/wakelock/ios"

SPEC CHECKSUMS:
Branch: 8aebcb7a6465f19f9f4d315acced369ae078d3f2
camera: a0ca5080336f7af47b88436e5e26da3dee5568f0
camera_with_rtmp: 606d566f89a21f1fed15ffda99cb247304beccd4
contacts_service: 849e1f84281804c8bfbec1b4c3eedcb23c5d3eca
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5
firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659
firebase_dynamic_links: 65b0918ed77292e87534b4b668d2e293c58f35e0
firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75
FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd
FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1
FirebaseDynamicLinks: 6eac37d86910382eafb6315d952cc44c9e176094
FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2
FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1
FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
flutter_branch_sdk: ecbe8c173d747c9f8d18a74e72de96cc9159375f
flutter_ffmpeg: 657ce8a1502c3d25bf34efc58b380b248836f772
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec
gallery_saver: 9fc173c9f4fcc48af53b2a9ebea1b643255be542
GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833
GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3
HaishinKit: d1786896ace24065d466bde02356c5352ac001b0
image_cropper: c8f9b4157933c7bb965a66d1c5e6c8fd408c6eb4
image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
libphonenumber: bd14d5abfc5939ab0b0767234e2d8e2593af258e
libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75
Logboard: e74ec2d9941abd22f4db3a3ddcd0735011df92c7
mobile-ffmpeg-https: 311fc4a8f671cf36d1d6b8f421e8246b790978d9
nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc
native_device_orientation: 3b4cfc9565a7b879cc4fde282b3e27745e852d0d
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6
PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97
Protobuf: 0cde852566359049847168e51bd1c690e0f70056
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
share_extend: b6748dc53695587891126a89533b862b92548c7b
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
Stripe: 92f1c73a9dbd3c54277ed06a1fea6e08f20414c6
stripe_payment: ad86f099179edb7b9fe12b9b62ac3746d5e56802
TOCropViewController: da59f531f8ac8a94ef6d6c0fc34009350f9e8bfe
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e
wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4

PODFILE CHECKSUM: 41bf8c5e7f33c17385779784d89132adf1e92e40

COCOAPODS: 1.10.0

@Ruxaxup
Copy link

Ruxaxup commented Feb 23, 2021

Any news on this? We need to publish an update :(

@stephen-pace
Copy link

It's still a problem for me unfortunately.

@lalkrishna
Copy link

Same issue for me. Just added stripe_payment: ^1.0.10 to my project. Then flutter run throws this issue.
Environment: Xcode Version 12.5 beta 3 (12E5244e).

@josh-burton
Copy link
Author

It happens if the min iOS version is set to 10 and above. If set to 9 then it works ok.

@lalkrishna
Copy link

lalkrishna commented Mar 16, 2021

It happens if the min iOS version is set to 10 and above. If set to 9 then it works ok.

Resolving dependencies of Podfile
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is
only perfomed in repo update
[!] CocoaPods could not find compatible versions for pod "stripe_payment":
In Podfile:
stripe_payment (from .symlinks/plugins/stripe_payment/ios)
Specs satisfying the stripe_payment (from .symlinks/plugins/stripe_payment/ios) dependency
were found, but they required a higher minimum deployment target.


To integrate latest version of Stripe SDK, we required min iOS 11.

@lalkrishna
Copy link

lalkrishna commented Mar 16, 2021

Same issue on Sample project too. Even if I didn't change any settings.

@tamirrab
Copy link

Same here on Xcode 12.5 beta 3

@siman302
Copy link

any update on this, i get that error on even on flutter_stripe_payment: 1.0.8
i just update my flutter version.

@jonasbark
Copy link
Owner

Can someone provide a repo with a minimal reproducible example?

@TusharSharma651
Copy link

Same here on Xcode 12.5 beta 3

@MulderPu
Copy link

Any updates on this?

@alexduros
Copy link

I think this is not related to this project directly (or maybe because it relies on the Objective-C implementation of Stripe Library). I do have the same issue on a completely other project which is not using flutter_stripe_payment.
Looking at the Release notes of Xcode 12.5, it seems that this is un update of Apple Clang Compiler which is breaking the "old" implementation of Stripe.
I guess the best way is to upgrade the dependency to a more recent version, even the latest one (which is a reimplementation in Swift).

@mclark4386
Copy link

I think this is not related to this project directly (or maybe because it relies on the Objective-C implementation of Stripe Library). I do have the same issue on a completely other project which is not using flutter_stripe_payment.
Looking at the Release notes of Xcode 12.5, it seems that this is un update of Apple Clang Compiler which is breaking the "old" implementation of Stripe.
I guess the best way is to upgrade the dependency to a more recent version, even the latest one (which is a reimplementation in Swift).

This seems to have been an on going things since February, so I don't know about that... that said if there is a newer version of the pod that work seamlessly with this plugin I would vote to update to it since there are normally a good number of security fixes and the like, and this issue may well be a deprecated version of the lib being used as the primary (I do think I fixed this at one point by hand changing my lock file to a newer version of the sdk)

@mclark4386
Copy link

I apologize @alexduros I think you are exactly right. After reading in a bit more it seems even stripe had been working on this since Feb https://github.com/stripe/stripe-ios/tree/v19.4.1 .

@diegopq
Copy link

diegopq commented Apr 30, 2021

some update of this issue, I am going to install version 12.4 of Xcode to see if it is solved

@diegopq
Copy link

diegopq commented Apr 30, 2021

uninstall the latest version of Xcode (12.5) and install 12.4 and everything worked fine.
Here you can download version 12.4:
https://developer.apple.com/download/more/

@mclark4386
Copy link

mclark4386 commented Apr 30, 2021

I had to get a build out, so I had done the same... For some reason Apple Pay doesn't show anymore, but I'm guessing that's something else, but yeah had to downgrade for now till someone else has or I have time to get the plugin updated to the latest SDK. :-/ Really wanted to help more, but too much going on at the moment, sorry!

@alexduros
Copy link

FYI, those errors can occur both on 12.4 and 12.5 version of Xcode, the "only" difference is that the error happen at build time on 12.5 and at runtime on 12.4.

@jonasbark
Copy link
Owner

@alexduros I highly doubt that - please provide more information if you receive errors on 12.4

@diegopq
Copy link

diegopq commented Apr 30, 2021

@jonasbark I was able to compile the app correctly, apparently it did not give me any runtime error or compile error, everything works fine, with version 12.5 of xcode it is when it gave me the error

@flutterq
Copy link

flutterq commented May 2, 2021

[Solved] ‘new’ is unavailable: You cannot directly instantiate an STPIssuingCardPin

@stephen-pace
Copy link

decided to upgrade to xcode 12.5 today and this issue started happening again. I ran 'pod update' and stripe upgraded from 19.4.0 to 19.4.1 and the problem is solved.

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