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

AWSMobileClient signIn webview freezes in XCode 16 and iOS 18. #5441

Closed
dcristolovean opened this issue Sep 20, 2024 · 16 comments
Closed

AWSMobileClient signIn webview freezes in XCode 16 and iOS 18. #5441

dcristolovean opened this issue Sep 20, 2024 · 16 comments
Labels
auth question General question

Comments

@dcristolovean
Copy link

dcristolovean commented Sep 20, 2024

Describe the bug
As the title states, the webview login screen completely freezes as soon as it loads.

MacOS Sequoia 15.0, no betas. The issue occurs only on XCode 16. Installing XCode 15.4 on the same machine (with a bit of trickery) works. The Login webview appears correctly and doesn't freeze.

To Reproduce

  1. Just a simple AWSMobileClient.default().showSignIn that worked before in the previous XCode and iOS17.x
  2. WebView starts, but freezes immediately. You can see the Cancel on top left, buttons top right and the bottom bar of the browser. Content is empty.

Observed Behavior
Web login completely frozen and empty, no button works from the webview

Expected Behavior
Normal standard login.

Code Snippet
AWSMobileClient.default().showSignIn(navigationController: nav, hostedUIOptions: hostedUIOptions) { userState, error in
.....
}

  • call gets stuck, nothing returned, webview frozen.

Screenshots
Simulator Screenshot - iPhone 16 Pro Max - 2024-09-20 at 19 23 11

Environment(please complete the following information):

  • SDK Version: 2.37.1
  • Dependency Manager: CocoaPods
  • Swift Version : latest
  • Xcode Version: 16

Device Information (please complete the following information):

  • Device: Simulator
  • iOS Version: 18
@github-actions github-actions bot added pending-triage Issue is pending triage pending-maintainer-response Issue is pending response from an Amplify team member labels Sep 20, 2024
@phantumcode
Copy link
Contributor

@dcristolovean Thanks for submitting the issue. We'll work on reproducing the issue and provide updates.
Does the issue exist when running on a real device with iOS 18? or when running with Xcode 18 but with iOS simulator running iOS 17.x?

@phantumcode phantumcode added the bug Something isn't working label Sep 20, 2024
@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 20, 2024
@dcristolovean
Copy link
Author

dcristolovean commented Sep 20, 2024

I only use the simulators at the moment. The issue appears when running all the 'new' stuff: Xcode 16, iOS18 simulators.

I am now running my code on the same machine, Xcode 15.4 downloaded and run separately from my XCode 16 and it works. In the 17.5 simulators, of course, I can't use an 18 simulator on XCode 15.4 :)

Ask me for any other details, this is quite urgent for us, I have to do some iOS 18 related fixes and if AWS fails, we're dead in the water. Thank you.

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 20, 2024
@dcristolovean
Copy link
Author

dcristolovean commented Sep 20, 2024

and on an unrelated note, but still iOS 18 related. We're using AWS AppSync. That SDK is dead, maintenance mode. There was an iOS 18 compile error issue, they fixed it but they only pushed in main, not created a new version, since it's... in maintenance mode.
So now that package depends on AWS 2.36.x

If you find and fix the issue I have with login, what will happen ? You'll bump the version to another 2.37.x which I won't get because of AppSync.

Maintenence mode or not, AppSync needs to update it's dependencies, otherwise the entire AWS SDK becomes useless in Xcode 16 and iOS18. You can't login anymore if you have AppSync in your app. Am I wrong here ?

@ruisebas
Copy link
Member

ruisebas commented Sep 20, 2024

Hi @dcristolovean. I was unable to reproduce this issue running a simple project in an iOS 18 simulator, the login webview loads successfully with no freezing. I've tried both with Xcode 15.4 and Xcode 16.

To help us investigate further, please provide the following:

  • The contents of your awsconfiguration.json file with sensitive information redacted.
  • Verbose logs when you attempt to present the login view. You can enable verbose logging by doing this:
    AWSDDLog.sharedInstance.logLevel = .verbose
    AWSDDLog.sharedInstance.add(AWSDDOSLogger.sharedInstance)

Regarding the AWS AppSync SDK, maintenance mode ended in September 1, 2024. As such, no new updates will be made as stated in our documentation. This includes upgrading its AWS SDK dependency.

@ruisebas ruisebas removed the pending-triage Issue is pending triage label Sep 20, 2024
@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 20, 2024
@ruisebas ruisebas added the pending-community-response Issue is pending response from the issue requestor label Sep 20, 2024
@dcristolovean
Copy link
Author

dcristolovean commented Sep 23, 2024

Hello.

  1. Here's my configuration. It's not an awsconfiguration.json file, it's a dynamic dictionary that is set into AWSInfo.configureDefaultAWSInfo. We have multiple targets and their info is configured server side and served via Firebase before we init AWS.

{
"PinpointTargeting": {
"Default": {
"Region": "eu-west-1"
}
},
"S3TransferUtility": {
"Default": {
"Region": "eu-west-1"
}
},
"PinpointAnalytics": {
"Default": {
"AppId": "xxxx",
"Region": "eu-west-1"
}
},
"CognitoUserPool": {
"Default": {
"PoolId": "eu-west-xxxx",
"Region": "eu-west-1",
"MigrationEnabled": true,
"AppClientId": "xxxx",
"AppClientSecret": "xxxx"
}
},
"AppSync": {
"business_chat_qa": {
"ClientDatabasePrefix": "ChatAppSyncApi-qa_AWS_IAM",
"AuthMode": "AWS_IAM",
"Region": "eu-west-1",
"ApiUrl": "https://qa.api-chat.xxxx.com/graphql"
}
},
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"Region": "eu-west-1",
"PoolId": "eu-west-1:xxxx"
}
}
},
"IdentityManager": {
"Default": {
"Region": "eu-west-1"
}
},
"Auth": {
"Default": {
"authenticationFlowType": "USER_PASSWORD_AUTH",
"OAuth": {
"Scopes": [
"openid",
"email",
"aws.cognito.signin.user.admin",
"phone",
"profile"
],
"SignOutRedirectURI": "xxx://signout",
"AppClientId": "xxxx",
"WebDomain": "xxxx.auth.eu-west-1.amazoncognito.com",
"AppClientSecret": "xxxx",
"SignInRedirectURI": "qa-xxx://signin"
}
}
}
}

  1. Logging doesn't help much in this particular case, there's nothing logged when I call AWSMobileClient.default().showSignIn

Before I ask the user to sign in, there are indeed operations done with AWS and those are OK, logs show what's happening and all's good. (we using API Gateway) - non-auth user

Then, asking the user to login -> I get the system dialog then webview stuck, no logs.

We use standard providers, like FB, Google, Apple and also other 3rd parties SSOs. They all get stuck in xcode 16, but they all work in 15.4

  1. I need also a working solution for AWSAppSync, so we don't get stuck with an old AWS version and can't update anymore in the future. I understand it's under maintenance, but you can't have a package that blocks your entire AWS framework from getting updates. What can I do in that case ? One thing would be to get rid of the AWSAppSync Pod and just add the AWSAppSync files by hand in my project, hoping it will work ?

Updating to Amplify is not a viable solution now, it will take an extremely long time because of all our services we're using. Only API Gateway has > 300 API requests, with the auto-generated models that come with it that now need to be done by hand, since Amplify doesn't auto-generate them. And many many other little things, Cognito, AppSync, S3, SNS, Pinpoint etc It's planned for the future, but out of the question at the moment.

  1. Here's my pod file:

AWS

pod 'AWSCore'
pod 'AWSRuntime'
pod 'AWSAPIGateway'
pod 'AWSPinpoint'
pod 'AWSPluginsCore'
pod 'AWSSNS'
pod 'AWSS3'
pod 'AWSCognitoIdentityProvider'
pod 'AWSMobileClient'
pod 'AWSAuthUI'
pod 'AWSUserPoolsSignIn'
pod 'AWSAppSync', :git => '[email protected]:awslabs/aws-mobile-appsync-sdk-ios.git', :tag => 'main'
  1. Not sure if it helps and it's not really visible in my screenshot, but when the webview is stuck, it's also not displayed correctly. It seems to have a ~ 20pt top safe area, but also a ~ extra 20pt bottom that makes the bottom bar being cut a bit, like it's out of the screen.

@github-actions github-actions bot added pending-maintainer-response Issue is pending response from an Amplify team member and removed pending-community-response Issue is pending response from the issue requestor labels Sep 23, 2024
@phantumcode
Copy link
Contributor

@dcristolovean Are you able to configure verbose logging and attach the log output for us to troubleshoot even if you think that the log is not helpful?

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 23, 2024
@dcristolovean
Copy link
Author

I created a test project that has the exact same issue.
The only logging I have is this:

Configuring SignInProvider : CognitoUserPool.
Registering SignInProvider AWSCognitoUserPoolsSignInProvider from awsconfiguration.json.

Then nothing when I press a button and start the SignIn process.

I created the project with our credentials so it actually connects to something. Is there a way to give that to you ?

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 23, 2024
@phantumcode
Copy link
Contributor

phantumcode commented Sep 23, 2024

@dcristolovean You can upload the project as a zip file with any sensitive or confidential information redacted.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 23, 2024
@dcristolovean
Copy link
Author

AWSTest.zip

It's just a simple proj I created today, all's in ContentView.swift. It starts AWS with a 'dynamic' dictionary and then tries to login via Google. You need to add your ids/secret.
Pods are already included, so it should work as it is.
Running on XCode 15.4 opens the webview and tries to login with Google, page loads.
Running on XCode 16 opens the frozen webview as shown in the previous screenshot.

Running both XCodes is a bit tricky, since officially XCode 15.4 doesn't work in macOS 15. I downloaded 15.4 from Apple and switching between XCodes with sudo xcode-select -s /Applications/Xcode.app/ and sudo xcode-select -s /Applications/Xcode154.app/

To actually start XCode 15.4, you need to Show Package Content on it, Contents -> MacOS -> and double click on XCode in there to actually start it.

Sorry if you knew that already.

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 23, 2024
@ruisebas
Copy link
Member

Thanks for providing the project. I'll take a look and post updates in here.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 23, 2024
@ruisebas
Copy link
Member

@dcristolovean I was able to reproduce the issue with the project you provided, which is very similar to the one I used when attempting to reproduce.

So I compared both of them and noticed you have arm64 as Excluded Architectures in your AWSTest target and the following in your Podspec file's post_install script:

    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end

Is there a reason you need this exclusion? I removed it and the project still builds successfully, and then the sign in webview loads correctly. As to why this is only now causing issues, my guess is that Apple changed something internally when building for iOS 18.


Regarding AppSync SDK for iOS, its maintenance mode has already ended, so there will be no more updates nor support going forward.
If you need to use it with the latest AWS SDK for iOS releases, another alternative besides copying the source files locally is to fork the repository, make the required changes and update your Podspec to use your fork instead. But please be aware that we cannot provide support for either option.

@ruisebas ruisebas added the pending-community-response Issue is pending response from the issue requestor label Sep 23, 2024
@dcristolovean
Copy link
Author

dcristolovean commented Sep 24, 2024

Oh yes, without that exclusion you'll get tons of errors in other Pods. Mostly Firebase and Google that also load BoringSSL or grpc and so on. Those don't even compile without those exclusions.
You can just try to add these to my Podfile:

pod 'FBSDKLoginKit'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'

# google
pod 'GoogleSignIn'
pod 'Firebase'
pod 'FirebaseCore'
pod 'FirebaseAnalytics'
pod 'FirebaseDynamicLinks'
pod 'FirebaseDatabase'
pod 'FirebaseAuth'
pod 'FirebaseFirestore'
pod 'FirebasePerformance'
pod 'FirebaseCrashlytics'

Even when I made this simple test project, I couldn't compile it with all these Pods, unless I have all those modification in the Pod file. From Excluded Architectures to Deployment Target set to 13, Disable Bitcode and so on.

Remove the Excluded Archs from the pod file, add those and do a pod install. I couldn't get it to work without excluding arm64. And that's what tons of post of the web suggest as a fix.
Now if this impacts some webview from AWS, we're in a pickle, aren't we ? :)

Any suggestions ?

LATER EDIT: But wait a minute, even AWS doesn't work if I comment out the excluded arm64. Project doesn't even compile, it cant' find any AWS imports and stops.
So... leave the Podfile as it is from my project, comment out this:

installer.pods_project.build_configurations.each do |config|
  config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end

Clear Derived Data, clear Build Folder and then try to compile. It won't work. Even AWS needs that :(
It's VERY important to clear the data/build folder, otherwise it's gonna work from cache. As soon as you clean up the project, with the commented excluded arch and pod install -> Error -> No such module AWSMobileClient.

@github-actions github-actions bot removed the pending-community-response Issue is pending response from the issue requestor label Sep 24, 2024
@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 24, 2024
@ruisebas
Copy link
Member

ruisebas commented Sep 24, 2024

@dcristolovean It is not true that AWS needs this setting to work, as I wasn't using it in my original simple product.
I've tried again in your project, cleaned the build folder and wiped DerivedData and it still builds and runs just fine.
Even after adding all the new pods you shared, the project works without that exclusion and the webview loads correctly.

So there might be something else going on in your workspace, or perhaps some of your dependencies are outdated (I found some evidence that Firebase used to need that setting but now doesn't, so that could be it). In any case, this is not an issue caused by the AWS SDK itself, so there's not much we can do about it.

As a side note, when you get those "No such module <Module>" errors, it means that the project build process failed, but not necessarily that <Module> is the one causing the failure, just that it didn't get built. For example, if some other module was building before <Module> and it fails, Xcode will show that it cannot find <Module> because it didn't get to build it.
You can check the actual build logs to find out what the real root cause is.

@ruisebas ruisebas added question General question and removed bug Something isn't working labels Sep 24, 2024
@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 24, 2024
@ruisebas ruisebas added pending-community-response Issue is pending response from the issue requestor pending-maintainer-response Issue is pending response from an Amplify team member and removed pending-maintainer-response Issue is pending response from an Amplify team member labels Sep 24, 2024
@dcristolovean
Copy link
Author

So the error occurred because I still had the excluded archs in the main proj, not only on the Pods proj. So it was building for x86_64 and that didn't work.

I used a clean Podfile and restarted the process, no more excluded archs. And in the end, it seems to be actually working now, no more freeze on the webview. Very interesting.

On a side note, doing a clean pod install with only AWS still doesn't work as it should. I support iOS16, it's set in the proj and in the podfile. Even so, some AWS projects in the Pods proj are set to iOS 8. This doesn't work, you'll get a compile error, something sqlite related that's not supported in some SDK. So you have to either manually set it to 16 or via the podfile at the end. Only then it will compile and everything works.

Thanks for identifying the issue in the end.

@github-actions github-actions bot added pending-maintainer-response Issue is pending response from an Amplify team member and removed pending-community-response Issue is pending response from the issue requestor labels Sep 24, 2024
@ruisebas
Copy link
Member

I'm glad to hear it's working for you now.

All of our pods have a minimum deployment version of iOS 12, so I don't know why you would get them as iOS 8. Perhaps some weird caching stuff again, but you can always upgrade them to the appropriate version.

Closing this issue.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth question General question
Projects
None yet
Development

No branches or pull requests

3 participants