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

Cant login on iOS 18, XCode 16 Beta 3 #534

Open
MSL-BIT opened this issue Sep 4, 2024 · 20 comments
Open

Cant login on iOS 18, XCode 16 Beta 3 #534

MSL-BIT opened this issue Sep 4, 2024 · 20 comments

Comments

@MSL-BIT
Copy link

MSL-BIT commented Sep 4, 2024

I wanted to ensure that my app runs smoothly on iOS 18, so I downloaded Xcode 16.0 beta 3 (16A5202i) and attempted to log in using AppAuth.

During testing on the simulator, I encountered an issue where the Safari ViewController appeared to freeze. The app didn’t crash, but it stopped producing console logs.

I'm using the flutter_appauth: ^7.0.0 version, and I also tested with version 6.0.7, but I experienced the same issue with both.

image

@sillydomnom
Copy link

I have exactly the same issue!

@scsinke
Copy link

scsinke commented Sep 11, 2024

I have the same issue. The thing is that when I run the package in a clean app it works with xcode 16 RC and iOS 18 simulator. @MSL-BIT can you confirm if for you it also works in a clean flutter app?

@RutgerVleuten
Copy link

RutgerVleuten commented Sep 11, 2024

@MSL-BIT Did you also check if this happens using a real device?

For me this only happens on iOS 18 simulators (also building with Xcode 15). When targetting a physical device I do not see the issue.

@RutgerVleuten
Copy link

The issue seems to happen when arm64 is excluded for simulator.

image

@serraojoao
Copy link

serraojoao commented Sep 17, 2024

Any solution for this? I am able to test on a real device (Iphone SE) but unable to run any testing on simulators.

[Edit] Using Simulator with iOS 17.5 allows me to test.

@MaikuB
Copy link
Owner

MaikuB commented Sep 21, 2024

I've tried the example app on an iPhone 16 simulator with iOS 18 and works fine

Simulator.Screen.Recording.-.iPhone.16.-.2024-09-21.at.10.33.01.mp4

The example app doesn't have any excluded architectures either so whilst I've not tried it out myself, I'm inclined to believe what @RutgerVleuten shared is the reason. Has everyone here already checked this? This would be a setting for your individual apps

@lohanmarques
Copy link

lohanmarques commented Sep 21, 2024

I was having the same issue for days and erasing excluded archs resolved for me

@sillydomnom
Copy link

For us, removing arm from the excluded archs is not really a possibility as the App is afterwards unable to be built. We then get an error like: Building for 'iOS-simulator', but linking in object file (...) built for 'iOS' where Stack Overflow mentions to add arm64 to the excluded archs: https://stackoverflow.com/questions/63607158/xcode-building-for-ios-simulator-but-linking-in-an-object-file-built-for-ios-f

@jonas2808
Copy link

@sillydomnom and me aligned to also try to run xCode 16.1 Beta 2 and the same issue is happening again.

@MSL-BIT
Copy link
Author

MSL-BIT commented Sep 26, 2024

So I did nothing but with the latest Flutter version it worked automatically. I do not know if this is connected to the Flutter upgrade but now the website is loaded successfully.

@RutgerVleuten
Copy link

RutgerVleuten commented Sep 27, 2024

@sillydomnom we have the same issue because there dependencies on MLKit that has no ARM64 simulator slice.

I managed to isolate the issue and it's on Apple's side. Seems running an app as Intel using Rosetta fails on an iOS 18.x simulator when starting an ASWebAuthenticationSession.

I reported it to Apple DTS with an example (see below) and waiting for response.

func authenticateWithGoogle() {
      // Google OAuth 2.0 Authorization URL (example)
      let clientID = "your-google-client-id.apps.googleusercontent.com"
      let redirectURI = "com.yourapp:/oauth2redirect"
      let scope = "profile%20email"
      let responseType = "code"
      let authURLString = """
      https://accounts.google.com/o/oauth2/v2/auth?client_id=\(clientID)&redirect_uri=\(redirectURI)&response_type=\(responseType)&scope=\(scope)
      """

      guard let authURL = URL(string: authURLString) else {
          print("Invalid authentication URL")
          return
      }

      let authSession = ASWebAuthenticationSession(
          url: authURL,
          callbackURLScheme: "com.yourapp"
      ) { callbackURL, error in
          if let error = error {
              print("Authentication failed: \(error.localizedDescription)")
          } else if let callbackURL = callbackURL {
              self.handleCallbackURL(callbackURL)
          }
      }

      authSession.presentationContextProvider = self
      authSession.start()
  }

@RutgerVleuten
Copy link

RutgerVleuten commented Sep 27, 2024

@MaikuB Issue is there when you exclude Arm64 from your build. When you have nothing filled in it is included, like in your example app, this app will run native on an Apple silicon machines.

If you exclude arm64 (by filling this in the excluded architectures) it runs your app's process as "Intel" using rosetta 2.

image

And in this case you have the issue of the login WebView getting stuck on an iOS 18 simulator.

See also my previous post

@Shakle
Copy link

Shakle commented Oct 10, 2024

I don't use ios simulator for 2 weeks already because of it. So we have to wait for Xcode 16.1 or AppAuth lib update?

@lauroboeni
Copy link

Same here...

@Shakle
Copy link

Shakle commented Oct 28, 2024

Xcode 16.1 with iOS 18.1 simulator, still does not work.

Please tell us what to wait for.. we can't use ios simulators for more than a month already. Deleting excluded architectures is not an option, because then something else stops working

@MaikuB
Copy link
Owner

MaikuB commented Oct 29, 2024

@Shakle did you read/see #534 (comment)?

@Shakle
Copy link

Shakle commented Oct 29, 2024

@MaikuB yes, but feels like it can be fixed even in a year or more, because Apple does not respond and care. So i thought that maybe some workaround is present, because i can't believe that everyone has just stopped using ios simulators.

@RutgerVleuten
Copy link

Had a call with Apple yesterday night to clarify the issue. It has now been escalated to the development team that's responsible for Simulators. They will send me an update if the issue is already on their backlog or if it's new.

Keep you posted.

note: since it's not a issue on a actual device and only i.c.w. Rosetta it will probably be not prioritised very high.

@MaikuB
Copy link
Owner

MaikuB commented Oct 29, 2024

@RutgerVleuten thanks. Based on what I could see online, this technically shouldn't be new to them and have seen some comments that it was raised during beta

https://forums.developer.apple.com/forums/thread/764367
https://forums.developer.apple.com/forums/thread/764468

@RutgerVleuten
Copy link

@MaikuB thanks for the links, have added them to the submitted case.

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

10 participants