首页 > 解决方案 > 由于缺少谷歌应用 ID,构建失败

问题描述

我已经看到这个问题正在发生,我尝试降级 Google App Id,甚至尝试升级它,但没有任何效果。我什至检查了更新,但仍然没有运气。当我实现它时,我遇到了这个错误,它说“缺少 Google 应用程序 ID”。有人可以帮忙吗?

这是来自 build.gradle(WeightTracker)

dependencies {
        classpath "com.android.tools.build:gradle:4.0.0"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.2.0'

    }

这是来自 build.gradle(app)

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


dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-storage'
    implementation platform('com.google.firebase:firebase-bom:25.4.1')
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

这是我不断收到的错误:

Missing Google App Id. Please follow instructions on https://firebase.google.com/ to get a valid config file that contains a Google App Id

标签: javafirebaseandroid-studio

解决方案


推荐阅读