Azure-Samples / ms-identity-mobile-apple-swift-objc

An iOS sample in Swift that authenticates Microsoft Account and Azure AD users and calls the Graph API using OAuth 2.0
https://aka.ms/aaddev
74 stars 37 forks source link

Thread 1: EXC_BAD_ACCESS (code=1, address=0x0) error #17

Closed jthake closed 4 years ago

jthake commented 6 years ago

I'm getting this error in the AppDelegate file when running the application immediately after I have signed in with either Personal Account or a Work account. When I try to consent the scope by clicking yes this error throws in debugging. I've tried this in the emulator and on a device.

Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)

i had to use the "master" carthage branch for MSAL.Framework as the "dev" branch was not building for MacOs at the time.

Any suggestions?

jthake commented 6 years ago

This error was happening in Xcode 9 beta. This error does not fire in Xcode 9.0.

jthake commented 6 years ago

This is still an issue now that Xcode 9.3 released and not in beta and that his is required for iOS devices on iOS 11.3 which is also released.

jthake commented 6 years ago

OK, so a lot of digging it seems that the Facebook SDK has the same issue with updates.

I added this to the AppDelegate class and it works again

    @available(iOS 9.0, *)
    func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {

        print("Received callback!")

        MSALPublicClientApplication.handleMSALResponse(url)

        return true
    }

Does someone want to verify this?

ghost commented 6 years ago

I'm having trouble in AppDelegate EXC_BAD_ACCESS (code = 1, address = 0x0) My problem is in Facebook SDK, I'm not able to solve it, I need help, everything was working, but updating xcode in version 9.3 now gives the error EXC_BAD_ACCESS (code = 1, address = 0x0)

ghost commented 6 years ago

Fixed: it was possible to solve the problem with the following code inside the Delegate:

@available (iOS 9.0, *) func application (_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey: Any]) -> Bool {

    print ("Received callback!")

    return FBSDKApplicationDelegate.sharedInstance (). application (application, open: url, options: options)

}
raninar commented 5 years ago

added the code that ghost put above but got the error "Expected unqualified-id" for the "@available (IOS 9.0,*)"

oldalton commented 4 years ago

Is this issue still happening with the latest sample and Xcode version?

oldalton commented 4 years ago

Closing this one due to inactivity. Please reopen if still experiencing the issue with the latest sample.