在 android studio 中构建应用程序后未生成值文件

发布于 2025-01-15 10:26:54 字数 514 浏览 5 评论 0原文

因此,我正在关注有关如何使用谷歌身份验证登录的 Firebase 文档,我一直在遵循每个步骤并添加了每个依赖项,但我在这段代码中遇到了错误:

// Configure Google Sign In
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
    .requestIdToken(getString(R.string.default_web_client_id))
    .requestEmail()
    .build();

 mGoogleSignInClient = GoogleSignIn.getClient(this, gso);

我在“default_web_client_id”中收到错误在我构建我的应用程序后,它应该在values.xml文件中生成,但是当我这样做时没有任何反应,我不知道如何解决这个问题,因为我是android studio的新手,任何帮助将不胜感激,谢谢!

So I'm following the Firebase documentation on how to sign in using google authentication, I have been following every step and I added every dependency, but I encounteted an error in this piece of code:

// Configure Google Sign In
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
    .requestIdToken(getString(R.string.default_web_client_id))
    .requestEmail()
    .build();

 mGoogleSignInClient = GoogleSignIn.getClient(this, gso);

I'm getting an error in "default_web_client_id" where it should be generated in a values.xml file after I build my app, but nothing happens when I do that, I have no idea how to solve this as I'm new to android studio, any help will be appreciated Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

红墙和绿瓦 2025-01-22 10:26:54

不知道这是否对每个人都有效,但我将我的项目提交到github,删除它然后再次克隆它,这似乎有效(也许gradle同步第一次没有正常工作),希望这对大家有帮助有同样的问题!

Don't know if this will work for everyone but I commited my project to github, deleted it and then cloned it again, and that seems to work (maybe the gradle sync didn't work properly the first time), hope this helps everyone with the same issue!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文