找不到与包名称"com.example.pc.fireApp"匹配的客户端 [英] No matching client found for package name 'com.example.pc.fireApp'

查看:79
本文介绍了找不到与包名称"com.example.pc.fireApp"匹配的客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

同步我的gradle时出现此错误.我认为问题来自google service.json文件.

找不到与程序包名称'com.example.pc.fireApp'相匹配的客户端".

我的职业:

 应用插件:'com.android.application'安卓 {compileSdkVersion 27defaultConfig {applicationId"com.example.pc.fireApp"minSdkVersion 19targetSdkVersion 27版本代码1versionName"1.0"testInstrumentationRunner"android.support.test.runner.AndroidJUnitRunner"}buildTypes {释放 {minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'}}}依赖项{实现fileTree(dir:'libs',包括:['* .jar'])实施'com.android.support:appcompat-v7:27.0.0'实现'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'实施'com.google.firebase:firebase-core:16.0.1'}应用插件:"com.google.gms.google-services"  

谢谢

解决方案

那是因为您最近在应用中更改了程序包名称,并且 google-services.json 文件不包含该程序包

您有2个选项,第一个是手动更改

在其请求的所有位置将软件包"com.example.pc.fireApp"放入 package_name

  Project-google-services.json文件 

选项2正在删除它,并再次与firebase连接(建议,因为第一个选项将在客户端更改程序包,它可以工作,但是您将在firebase控制台中看到一个不同的程序包,并且可能会导致以下问题:未来)

在您的IDE,Firebase中转到工具"并连接任何服务,请记住之前先删除google-services.json

I have this mistake when I sync my graddle. I think the problem comes from the google service.json file.

"No matching client found for package name 'com.example.pc.fireApp'".

My graddle :

 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'

Thanks

解决方案

Thats because you recently changed your package name in your app and your google-services.json file is not with that package

you have 2 options, first one is changing it manually

put your package "com.example.pc.fireApp" in all the places it requests package_name

Project - google-services.json file

option 2 is deleting it and connect again with firebase ( Recommended since the first option will change the package at client side , it will work but you will see a different package in your firebase console and can lead to problems in the future )

go to Tools in your IDE, Firebase and connect with any service , remember to delete google-services.json before

这篇关于找不到与包名称"com.example.pc.fireApp"匹配的客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆