Monday, June 27, 2022
HomeiOS Developmentios - Can't discover kind 'ASAuthorizationControllerDelegate' in scope when archiving

ios – Can’t discover kind ‘ASAuthorizationControllerDelegate’ in scope when archiving


macOS Monterrey 12.0.1 (21A559)

Xcode 13.3.1 (13E500a)

iOS app deployment goal 10.0

I’ve been working with this app for just a few years now, when the Apple authentication was launched, I applied it within the app, all had been going properly however…

I’m doing an replace, with small fixes and primarily adjustments of favor, I labored on the replace, examined in actual units and simulators, then archived and uploaded for take a look at flight for additional testing.

Yesterday 11/05/2022, I did some adjustments I used to be requested, after the take a look at flight customers reported somethings, such issues had been minor and under no circumstances included the Apple authentication. So I labored on the adjustments, examined once more in simulators and actual units and all was prepared for archiving.

I hit archive, so I can add a brand new model to check flight and am welcomed with the message:

error: can not discover kind 'ASAuthorizationControllerDelegate' in scope
extension ActivityUtils: ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding {
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: can not discover kind 'ASAuthorizationControllerPresentationContextProviding' in scope
extension ActivityUtils: ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding {
                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: can not discover kind 'ASPresentationAnchor' in scope
func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor {
                                                                      ^~~~~~~~~~~~~~~~~~~~
error: can not discover kind 'ASAuthorizationController' in scope
func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor {
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
error: can not discover kind 'ASAuthorizationController' in scope
func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) {
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~
error: can not discover kind 'ASAuthorization' in scope
func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) {
                                                                                                                ^~~~~~~~~~~~~~~
error: can not discover kind 'ASAuthorizationController' in scope
func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) {
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~
error: can not discover 'ASAuthorizationAppleIDProvider' in scope
    let appleIDProvider = ASAuthorizationAppleIDProvider()
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: can not discover 'ASAuthorizationController' in scope
    let authorizationController = ASAuthorizationController(authorizationRequests: [request])
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
error: can not discover kind 'ASAuthorizationAppleIDCredential' in scope
    if let appleIDCredential = authorization.credential as? ASAuthorizationAppleIDCredential {
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: can not discover kind 'ASAuthorizationError' in scope
    guard let error = error as? ASAuthorizationError else {
                                ^~~~~~~~~~~~~~~~~~~~

I’m not positive the place to go from right here, I cleaned the construct folder, I deleted all cache from xcode, restarted xcode, restarted the pc, obtained annoyed and left it as is, a while later I attempted once more and the factor works.

My greatest guess was that perhaps in the course of the archive course of, Xcode queries some server to obtain the AuthenticationServices bundle and perhaps it was down, so I forgot about it.

Yesterday I additionally did some assessments on the app that I obtained from take a look at flight and located a bug, I went to repair it and I used to be able to archive once more, after which the error once more, time and again, this time the ready didn’t assist, I began looking for solutions throughout and couldn’t discover anybody with the very same concern, nevertheless, from comparable points I adopted some recommendation, so as to add the next:

#if arch(arm64) || arch(i386) || arch(x86_64)
    //mycode
#endif

round the issue areas, which truly labored, however the query stays, why it has stopped working all the sudden, does anybody have a clue?

I’m additionally questioning if there’s a explicit new requirement for AuthenticationServices? I looked for it and so far as I can inform, the one requirement is iOS 13 or better. May this additionally must do with the Monterrey and Xcode 13 replace?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments