【问题标题】:File google-services.json is missing from module root folder (but it is at the good place ! )模块根文件夹中缺少文件 google-services.json(但它在好地方!)
【发布时间】:2016-04-27 22:39:39
【问题描述】:

我尝试在我的 android 应用程序中使用 google 登录,我阅读了页面 https://developers.google.com/identity/sign-in/android/start-integrating 并完成了所有步骤,现在我将我的 google-services.json 放在我的应用程序文件夹中,并在下载 google-services 后。 json,我愿意:

mv Dowloads/google-services.json AndroidStudioProjects/MyApplication/app/

所以,当我这样做的时候:

ls AndroidStudioProjects/MyApplication/app/
app.iml  build  build.gradle  google-services.json  libs  proguard-rules.pro  src

我的文件 google-services.json 似乎在好地方,但 gradle 控制台显示错误:

* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

我读了Error "File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it",但这不是我的问题,因为我的文件在好地方。

ps : 抱歉我的英语不好;p

【问题讨论】:

    标签: android json google-maps gradle


    【解决方案1】:

    如果您还没有在 Gradle 文件中添加这些代码行,您还需要这样做。 在 Module:app_name gradle 文件中,添加

    apply plugin: 'com.google.gms.google-services'
    

    在文件顶部。并在同一个文件的依赖中,添加

    compile 'com.google.android.gms:play-services:8.3.0'
    

    另外,在 Project:project_name gradle 文件中,添加

    classpath 'com.google.gms:google-services:2.0.0-alpha2'
    

    在依赖中

    另外,如果这不能解决您的问题,请尝试上传堆栈跟踪的屏幕截图

    【讨论】:

      【解决方案2】:

      下载 google-service.json 文件 复制该文件并将其粘贴到 YourProjectName/app 目录中

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-01-25
        • 2016-07-27
        • 2016-02-25
        • 2016-06-02
        • 1970-01-01
        • 2020-11-07
        相关资源
        最近更新 更多