如何解决 google 登录集成中的 "com.google.android.gms.auth.api.signin.internal.SignInHubActivity" ActivityNotFoundException 问题

How to resolve issue of "com.google.android.gms.auth.api.signin.internal.SignInHubActivity" ActivityNotFoundException in google signin integration

我已经在 android 应用程序中集成了 google 登录,但是当 运行 应用程序出现异常时,如:

android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example/com.google.android.gms.auth.api.signin.internal.SignInHubActivity};

have you declared this activity in your AndroidManifest.xml?

你能告诉我如何在 AndroidManifest.xml 文件中声明 SignInHubActivity

真的,我犯了一个非常愚蠢的错误。 我只是声明 activity 见下文...

<activity
          android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateAlwaysHidden|adjustPan" />

现在我的问题解决了。 Google 登录工作正常....谢谢

您是否将 Eclipse 与 ADT 一起使用? (Android 开发工具插件)。您是否已按照此处的说明设置 Google Play 服务 SDK? https://developers.google.com/android/guides/setup

如果您设置正确,我相信 SignInHubActivity 定义会自动从 Google Play 服务 SDK 合并到您的清单中,您不需要显式声明它。

我遇到了同样的问题。最后我解决了它。这是由 "Manuel Migration to AndroidX" 引起的。我已按照此视频中的说明进行操作:https://www.youtube.com/watch?v=0FZ_eUIsLTg

问题已解决。

关键是升级compileSdkVersion到最新。并且建议在文件 build.gradle, app/build.gradle, pubspec.yaml.[ 中制作所有版本 up-to-date =11=]

然后 Android Studio 管理迁移成功,ActivityNotFoundException 问题已解决。

最后提醒土耳其人。 您应该更改这些关键字(在 app/build.gradle 中)如下:

testImplementation -> testİmplementation

androidTestImplementation -> androidTestİmplementation