【问题标题】:No matching client found for package name 'com.example.pc.fireApp'找不到与包名称“com.example.pc.fireApp”匹配的客户端
【发布时间】:2019-06-19 20:25:13
【问题描述】:

我在同步我的 graddle 时遇到了这个错误。我认为问题来自 google service.json 文件。

“未找到与包名称 'com.example.pc.fireApp' 匹配的客户端”。

我的毕业生:

 apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.pc.fireApp"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.google.firebase:firebase-core:16.0.1'
}
 apply plugin: 'com.google.gms.google-services'

谢谢

【问题讨论】:

    标签: java android json firebase android-studio


    【解决方案1】:

    那是因为您最近在应用中更改了包名称,而您的 google-services.json 文件不在该包中

    你有两个选择,第一个是手动更改它

    将你的包“com.example.pc.fireApp”放在它请求的所有地方package_name

    Project - google-services.json file
    

    选项 2 正在删除它并再次与 firebase 连接(推荐,因为第一个选项将在客户端更改包,它会起作用,但您会在 firebase 控制台中看到不同的包,并可能导致出现问题未来

    在你的 IDE、Firebase 中打开 Tools 并连接任何服务,记得在之前删除 google-services.json

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-19
      • 2019-01-13
      • 1970-01-01
      • 1970-01-01
      • 2021-10-08
      • 2018-06-14
      相关资源
      最近更新 更多