在 Android Studio 中放置 credentials.json 的位置

Posted

技术标签:

【中文标题】在 Android Studio 中放置 credentials.json 的位置【英文标题】:Where to put credentials.json in Android Studio 【发布时间】:2018-07-02 00:21:18 【问题描述】:

我做了一个涉及 Google 登录的项目。

下载的文件是 credentials.json。

我把这个放在哪里?

从 google-services.json 更改后

注意:我没有使用 Firebase。

【问题讨论】:

【参考方案1】:

最常见的位置是在您的project_folder/app 文件夹中。

【讨论】:

没用.. google-services.json 和 credentials.json 的架构也不同。 这也没有解决我的问题。应用程序仍然显示“找不到资源”。有什么帮助吗?【参考方案2】:

您不需要 credentials.json 文件即可将基本的 google 登录添加到您的应用中

按照这个 url 并单击 Configure a project 按钮添加包名称和密钥 sha-1 指纹,你应该很高兴

https://developers.google.com/identity/sign-in/android/start-integrating

查看这个 google 示例项目以获得完整的实现

https://github.com/googlesamples/google-services/tree/master/android/signin

【讨论】:

credentials.json 用于 Web 应用程序

以上是关于在 Android Studio 中放置 credentials.json 的位置的主要内容,如果未能解决你的问题,请参考以下文章

在Android Studio中设置多个警报

如何使用 C# 在 Visual Studio 中放置图像? [关闭]

在 Visual Studio 中,我可以在只有调试符号的代码中放置断点吗?

在 Visual Studio 中放置并插入 unordered_map?

如何在 Visual Studio Code 中放置自定义输入以进行调试

Android:在 onBindViewHolder 中放置 setOnclickListener 或 setOnLongClickListener 是不是正确?