google / GoogleSignIn-iOS

Enables iOS and macOS apps to sign in with Google.
https://developers.google.com/identity/sign-in/ios
Apache License 2.0
491 stars 198 forks source link

The App crashes when launched via Widget. #433

Closed FitmaoCyber closed 4 months ago

FitmaoCyber commented 4 months ago

Steps:

  1. Create a widget code like this:

    public struct TestWidget: Widget {
    let kind: String = "TestWidget"
    
    public init() {}
    
    public var body: some WidgetConfiguration {
        StaticConfiguration(kind: kind, provider: WidgetProvider()) { entry in
            if #available(iOSApplicationExtension 17.0, *) {
                widgetView()
                    .containerBackground(for: .widget) {
                        Color(.black)
                    }
            }
            else {
                widgetView()
            }
        }
        .configurationDisplayName("")
        .description("")
        .supportedFamilies([.systemMedium])
    }
    
    private func widgetView() -> some View {
        Text("TEST")
    }
    }
  2. Add this widget to the home screen.

  3. Click this widget, app will launch.

  4. The app will crash immediately at the location shown in these screenshots: 截屏2024-05-31 10 07 54 截屏2024-05-31 10 07 42

At the moment, it appears that this issue cannot be reproduced on other devices. It is yet to be determined whether it is related to the OS environment.

Environment

mdmathias commented 4 months ago

I think perhaps that this issue is for another repo: https://github.com/google/GoogleUtilities/tree/main. Please let me know if that's not correct.