aboutyou / dart_packages

Dart and Flutter plugins maintained and used by @ABOUTYOU
221 stars 150 forks source link

[sign_in_with_apple] iOS 14 Simulator issues #144

Open bakeyevrus opened 4 years ago

bakeyevrus commented 4 years ago

Hello,

I am having trouble after the iOS 14 upgrade. Nothing happens when I am entering iCloud credentials. Technically speaking the code below is never 'awaited' and there is no exception thrown (until I cancel the operation manually).

 final credentials = await SignInWithApple.getAppleIDCredential(
        scopes: [
          AppleIDAuthorizationScopes.email,
          AppleIDAuthorizationScopes.fullName,
        ],
      );

I know, that for iOS 14 support we have to upgrade Flutter to either 1.22-beta or 1.20.4-stable, but it didn't help (I've tried 1.22-beta). However, it works perfectly for iOS 13.5.

Here is the output from flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 1.22.0-12.1.pre, on Mac OS X 10.15.6 19G2021, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 12.0)
[✓] Android Studio (version 4.0)
[!] VS Code (version 1.49.1)
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (2 available)

I am wondering If I am the only one who is having such a problem.

SiWA iOS 14

abhishek1214 commented 4 years ago

even i am facing this issue. Any fix for this?

HenriBeck commented 4 years ago

@bakeyevrus do you see any logs in XCode maybe which could point into a direction? For our own app, the plugin is working with flutter 1.17 on iOS 14. I can't speak to the flutter upgrade itself, there I would have to see if it still works.

abhishek1214 commented 4 years ago

Here is a snippet of the system logs for the simulator.

Sep 21 19:13:39 MacBook-Pro akd[32170]: objc[32170]: Class AKCASatoriReporter is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AuthKit.framework/akd (0x107f870a8) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AuthKitUI.framework/AuthKitUI (0x113bc2008). One of the two will be used. Which one is undefined. Sep 21 19:13:39 MacBook-Pro akd[32170]: objc[32170]: Class AKCATiburonAuthorizationUIReporter is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AuthKit.framework/akd (0x107f877d8) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AuthKitUI.framework/AuthKitUI (0x113bc2238). One of the two will be used. Which one is undefined. Sep 21 19:13:39 MacBook-Pro akd[32170]: objc[32170]: Class AKCATiburonRequestReporter is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AuthKit.framework/akd (0x107f86658) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AuthKitUI.framework/AuthKitUI (0x113bc27d8). One of the two will be used. Which one is undefined.

bakeyevrus commented 4 years ago

@HenriBeck, I have a similar log entry as @abhishek1214 does. However, there is nothing logged whenever I try to Sign In with Apple. So I cannot guarantee, that this is relevant information.

system.log ` Sep 21 15:14:27 MacBook-Pro coreauthd[68748]: objc[68748]: Class OwnerInfo is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/LocalAuthentication.framework/Support/coreauthd (0x10fce7038) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/LocalAuthentication.framework/Support/ModulePlugins/ModuleACM.bundle/ModuleACM (0x110a16e80). One of the two will be used. Which one is undefined. Sep 21 15:14:27 MacBook-Pro coreauthd[68748]: objc[68748]: Class OwnerInfos is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/LocalAuthentication.framework/Support/coreauthd (0x10fce7088) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/LocalAuthentication.framework/Support/ModulePlugins/ModuleACM.bundle/ModuleACM (0x110a16ed0). One of the two will be used. Which one is undefined. `

P.S Checked with Flutter 1.17.3 and iOS 14 - issue persists. I will keep digging :)

HenriBeck commented 4 years ago

It looks almost like something went wrong when upgrading XCode and nothing specific with the library.

Maybe try deleting XCode and then installing it again? From the logs, it looks like there is a duplication issue within the built-in frameworks of iOS

bakeyevrus commented 4 years ago

I noticed, that I am not able to use Apple ID even with Safari. Exactly the same issue persists when I am trying to log in to iCloud. Now I believe you can do nothing with that as it should be a bug on OS level :)

Here is the post with similar issues: https://developer.apple.com/forums/thread/651533?answerId=619965022#619965022

I think we can close it, thanks! Or leave it open, so I can notify if reinstalling XCode worked for me :)

UPD: XCode 12 reinstall didn't work. XCode 12.2- beta didn't help as well.

tp commented 4 years ago

@bakeyevrus Thanks for sharing! (And please still do comment further if you found what exactly fixed it for you.)

Feel free to reach out again if you have any further issue integration SiwA into your app.

HenriBeck commented 4 years ago

I will reopen this ticket as more people are getting this. If anyone found a fix for the solution or has more XCode logs about it, please post them so we can find a fix together.

HenriBeck commented 4 years ago

@bakeyevrus @tr-stan @enyo The issue only affects the simulator and not real iPhones correct?

enyo commented 4 years ago

@HenriBeck only on simulators, iPhones work normally, yes!

ashishbeck commented 4 years ago

For SiwA to work, do we have to upgrade to xcode 12 or is 11.7 with flutter 1.22 beta enough? I just used Xcode 12.2 beta to publish to the app store for the first time and it said New apps and app updates must be built with the public (GM) versions of Xcode 11 or later, iOS, macOS, watchOS, and tvOS SDKs. Apps built with beta versions aren’t allowed.

I didn't know this would happen because it's my first time submitting to the app store. I have a build that I made using flutter 1.22 beta and xcode 11.7 and I was wondering if SiwA would work on devices running iOS 14 before I do the whole ordeal of uninstalling and reinstalling xcode all over again.

I don't have access to a physical iPhone which is why I can't test it myself

HenriBeck commented 4 years ago

@abhishek1214 building the App with XCode 11.7 will not impact the possibility to run the app on iOS 14.

ashishbeck commented 4 years ago

Yes, but will it trigger the UI to show up SiwA in devices running iOS 14?

HenriBeck commented 4 years ago

Yes it will, we are currently using XCode 11.4 for our app and Sign in with Apple works on iOS 14.

ashishbeck commented 4 years ago

Great, thanks for the information

AllanCoinaski commented 4 years ago

Hello, I'm also having the same problem, but it didn't work with Xcode 11.4 or 11.7

HenriBeck commented 4 years ago

@AllanCoinaski could you please post the logs from XCode when trying to sign in and the output of flutter doctor -v?

deva666 commented 4 years ago

Same here

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.6 19G2021, locale en-GB)

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.49.1)
[✓] Connected device (1 available)

! Doctor found issues in 1 category.
kaushikb1996 commented 4 years ago

Facing the same issue with new Xcode and iOS 14 simulator.

eliabieri commented 4 years ago

Having the same issues as described by @kaushikb1996

AllanCoinaski commented 4 years ago

@HenriBeck

[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.6 19G2021, locale pt-BR) • Flutter version 1.20.4 at /Users/allan/flutter • Framework revision fba99f6cf9 (3 weeks ago), 2020-09-14 15:32:52 -0700 • Engine revision d1bc06f032 • Dart version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/allan/Library/Android/sdk • Platform android-30, build-tools 30.0.2 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1) --------- PS: also 11.7 and 11.4 • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.0.1, Build version 12A7300 • CocoaPods version 1.9.3

[✓] Android Studio (version 4.0) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 49.0.2 • Dart plugin version 193.7547 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.49.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.15.0

andrewsdv commented 4 years ago

The same issue to me. Please help.

Aanu1995 commented 4 years ago

Am facing the same issue in iOS 14 simulator.

ioridev commented 4 years ago

So far, the IOS14 simulator is not running Apple sign-in. To see how Apple Sign In works, you need to use a real machine or an ios13 simulator. ...

see this thread on Apple's forums. https://developer.apple.com/forums/thread/651533.

Downgrade the ios simulator:

First install xcode-install gem: gem install xcode-install When check what iOS simulators are available: xcversion simulators Install desired simulator i.e: xcversion simulators --install='iOS 13.5'

Use the ios 13.5 version to test and develop the apple sign in.

Than set the iOS Deployment Target to 13.5

Test your application with the apple sign in, upload, submit for review. And thats it, there will be no problem with the review.

So this is not a flutter or package issue.

kawaldeep2507 commented 4 years ago

same thing happening working on real devices but not iOS 14 simulator.

ibrahimbroachwala commented 4 years ago

+1 with the issue.

Simulator: iOS14 Flutter: stable 1.22.0 Xcode: v12.0.1

KirillBorodin commented 4 years ago

+1 Simulator: iOS14 Flutter: stable 1.22.0 Xcode: v12.0.1

after clicking just nothing happened there

SaowaluckT commented 4 years ago

I got same issue, my app has been rejected due to this issue. Pls help me.

HenriBeck commented 4 years ago

@SaowaluckT your App can't be rejected for this exact issue, as this only happens within the simulator. If Sign in with Apple is not working on a real device, this has likely other reasons.

SaowaluckT commented 4 years ago

@HenriBeck Thank you.

Arya-Wang commented 4 years ago

@SaowaluckT Have you solved the problem? Reasons for rejection:“Specifically, we were unable to login via Sign in with Apple.” But I successfully logged in using the real device.

jfelipe72 commented 3 years ago

+1 Simulator: iOS14 Flutter: stable 1.22.0 Xcode: v12.0.1

But I successfully logged in using version 13.5 on the simulator and I also managed with real devices.

mortifactor commented 3 years ago

Rejected my app too. Message from apple:

We discovered one or more bugs in your app when reviewed on iPhone running iOS 14.0.1 on Wi-Fi. Specifically, after Sign in with Apple the app displayed an error message.

phanvanluan94 commented 3 years ago

Still waiting for a fix, seems my app would get rejected.

HenriBeck commented 3 years ago

Rejection reason has nothing to do with this issue. It is only known that Sign in with Apple currently doesn't work on Simulator with iOS 14.

If your App gets rejected, please check Sign in with Apple on a real device where it is working when set up properly according to our README.

Marek00Malik commented 3 years ago

I recommend connecting a real device to IDE and run Debug on it. If you need to get your hands on any JWT tokens or etc. That was my workaround when debugging some issues with Apple's authentication.

PiN73 commented 3 years ago

If nothing happens after entering password and pressing Continue even on iOS 13 simulator, check this:

thongvo109 commented 3 years ago

Hi everyone,

You need add Sign in With Apple at Runner -> Signing & Capabilities -> Capability and select Sign in With Apple. I did try, it worked with iOS( 14.3 ) maybe previous version still can work.

Screen Shot 2020-12-30 at 3 48 04 PM
jaredgreener commented 3 years ago

I am also having the same issue. SiwA works on real device, but hangs on simulator. Tried the advice about enabling capabilities both in XCode with managed certs as well as in developer.apple.com and re-installing provisioning profile. Clean Build folder, reset simulator, etc...

My app was also rejected since the testers use a simulator to test and it failed for them.

Any luck making this work for anyone else??

abdusahin commented 3 years ago

same problem here, works on real device but not on simulator 14.3

Flutter 1.22.6 • channel stable • https://github.com/flutter/flutter.git Framework • revision 9b2d32b605 (4 days ago) • 2021-01-22 14:36:39 -0800 Engine • revision 2f0af37152 Tools • Dart 2.10.5 Xcode Version 12.3 (12C33)

joaovvrodrigues commented 3 years ago

@jaredgreener The update I made on my app had been refused for the same reason, but I appealed to ask them to test it on a simulator version less than 14. Later on, my update was accepted. I advise you to do the same.

As a resource I sent the links to the apple forum available above and this git.

TaiwoDevOps commented 3 years ago

how do yoy guys have it working on actual device at all, cos in my case it doesnt even work with simulator (14.4) and on actual device i get "Could not sign in" error. nothing logged to console.

tijanirf commented 3 years ago

how do yoy guys have it working on actual device at all, cos in my case it doesnt even work with simulator (14.4) and on actual device i get "Could not sign in" error. nothing logged to console.

Do you manage to fix the problem? I tried to appeal as @joaovvrodrigues suggested but it got rejected hours later.

TaiwoDevOps commented 3 years ago

No luck with that yet bro, I will keep this communication line open if I get anything.

On Mon, 8 Mar 2021, 10:27 am Tijani Rijal Fadhilah, < notifications@github.com> wrote:

how do yoy guys have it working on actual device at all, cos in my case it doesnt even work with simulator (14.4) and on actual device i get "Could not sign in" error. nothing logged to console.

Do you manage to fix the problem? I tried to appeal as @joaovvrodrigues https://github.com/joaovvrodrigues suggested but it got rejected hours later.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aboutyou/dart_packages/issues/144#issuecomment-792615356, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKPLJT5VHMQNW46TJC2X2VDTCSJ7DANCNFSM4RUQEIBQ .

ekleel commented 3 years ago

This issue is also happening with our app. The app got rejected as well even though we appealed as @joaovvrodrigues suggested. They are saying that they always use actual devices for reviews.

In the simulator we're getting the same issue that the OP faces. But on an actual device we get a different issue. The first login works just fine, but after logout we couldn't log back in. On the second login we couldn't get the credentials we needed, there is no email or anything else. The user has to remove the app access to Apple service from their device settings in order to get fresh credentials.

Is there anything we can do to help fix this issue? Apple refuses to approve our app update. They didn't specify the results they're getting, so I'm not sure if it's the same issue that we found on the simulator or the actual device.

sign_in_with_apple: ^3.0.0

Xcode: 12.4
Simulator: iOS 14.4 - iPhone 12 Pro Max
Device: iPad Pro

[✓] Flutter (Channel dev, 2.1.0-10.0.pre, on Mac OS X 10.15.5 19F101 darwin-x64,
    locale en-SA)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.55.0)
[✓] Connected device (3 available)
hdavidmb commented 3 years ago

I'm also having this issue on simulator. Apparently it's also happening to native developers, look at this https://developer.apple.com/forums/thread/651533

HenriBeck commented 3 years ago

@ekleel

In the simulator we're getting the same issue that the OP faces. But on an actual device we get a different issue. The first login works just fine, but after logout we couldn't log back in. On the second login we couldn't get the credentials we needed, there is no email or anything else. The user has to remove the app access to Apple service from their device settings in order to get fresh credentials.

This is an issue in your App then as it is intended that you don't get the credentials (email and names) in the second login. This is also described on the docs of these fields: https://github.com/aboutyou/dart_packages/blob/master/packages/sign_in_with_apple/lib/src/authorization_credential.dart#L61

You will need to save these credentials in some backend so you can access them later again.

ekleel commented 3 years ago

@ekleel

You will need to save these credentials in some backend so you can access them later again.

I see, thanks for the clarification.

aleksandar-radivojevic commented 3 years ago

Any updates?

TaiwoDevOps commented 3 years ago

yes, i have been able to solve that issue. stacked_firebase_auth

On Thu, Apr 29, 2021 at 1:40 PM Aleksandar Radivojevic < @.***> wrote:

Any updates?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aboutyou/dart_packages/issues/144#issuecomment-829204116, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKPLJT26BKMVGMCGI6NEVSLTLFHSZANCNFSM4RUQEIBQ .