jonasbark / flutter_stripe_payment

[DISCONTINUED] A flutter plugin with stripe payment plugin integration
MIT License
309 stars 244 forks source link

error: 'new' is unavailable: You cannot directly instantiate an STPIssuingCardPin #246

Open josh-burton opened 3 years ago

josh-burton commented 3 years ago

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 commented 3 years ago

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

josh-burton commented 3 years ago

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

jonasbark commented 3 years ago

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 commented 3 years ago

here's the whole podfile.lock

PODS:

DEPENDENCIES:

SPEC REPOS: trunk:

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 commented 3 years ago

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

stephen-pace commented 3 years ago

It's still a problem for me unfortunately.

lalkrishna commented 3 years ago

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 commented 3 years ago

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

lalkrishna commented 3 years ago

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 commented 3 years ago

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

tamirrab commented 3 years ago

Same here on Xcode 12.5 beta 3

siman302 commented 3 years ago

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

jonasbark commented 3 years ago

Can someone provide a repo with a minimal reproducible example?

TusharSharma651 commented 3 years ago

Same here on Xcode 12.5 beta 3

MulderPu commented 3 years ago

Any updates on this?

alexduros commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

diegopq commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

diegopq commented 3 years ago

@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 commented 3 years ago

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

stephen-pace commented 3 years ago

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.