Hello Guys, How are you all? Hope You all Are Fine. Today When I run my app in XCode I found two errors that cause the build to fail: ‘new’ is unavailable: You cannot directly instantiate an STPIssuingCardPin in Swift. So Here I am Explain to you all the possible solutions here.
Without Wasting your time, Lets start This Article to Solve This Error.
How ‘new’ is unavailable: You cannot directly instantiate an STPIssuingCardPin Error Occurs ?
I can’t build my app on Xcode. I’ve already updated all cocoa pods 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
'new' is unavailable: You cannot directly instantiate an STPIssuingCardPin
How To Solve ‘new’ is unavailable: You cannot directly instantiate an STPIssuingCardPin Error ?
Question: How To Solve ‘new’ is unavailable: You cannot directly instantiate an STPIssuingCardPin Error ?
Answer: You just have to change the pod… I had it to a previous version. So specifically check out which version you have in your podfile.
Solution 1
You just have 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'
Solution 2
Note that this is happening since Xcode 12.5, so you can either downgrade to Xcode 12.4 (which is what I did due to a dependency that gave me more errors when upgrading Stripe), or upgrade stripe to at least 21.3.1, or one of the versions the fix has been backported to (19.4.1, 17.0.3, 15.0.2, and 14.0.1) in this pull request.
For those of you who are using Cocoapods: note that none of the above versions appear to be available there, and, according to this issue, it appears they won’t be, at least not 19.4.1, which is what I needed.
Summery
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also Read