重命名程序包后,Android Studio会引发未找到匹配的客户端的情况 [英] Android studio after renaming package it throws No matching client found
问题描述
我点击了以下链接以重命名该软件包.重命名后,当我尝试构建项目时,android studio会引发类似错误.
I followed the below link for renaming the package. After renaming when i try to build the projects android studio throws error like.
错误:任务':app:processDebugGoogleServices'执行失败. 找不到与包名称'com.example.app'匹配的客户端
Error:Execution failed for task ':app:processDebugGoogleServices'. No matching client found for package name 'com.example.app'
推荐答案
您已将Google Play服务插件添加到项目中,该插件将从您的应用模块中的google-services.json
中读取.
You have added the Google Play Services plugin to the project, which reads from the google-services.json
found in your app module.
google-services.json
包含服务配置数据,例如Google Project ID,应用程序包名称等.
The google-services.json
contains service configuration data, such as Google Project ID, application package name, etc..
由于应用程序包名称也存储在该json中,因此不再匹配,因此您必须在Firebase控制台中创建一个新应用程序,并导出新的配置json.
Since the application package name is also stored in that json, it will not match anymore, so you have to create a new application in your Firebase console, and export the new configuration json.
然后用生成的内容替换项目中的google-services.json
.
Then replace the google-services.json
in your project with the one you have generated.
这篇关于重命名程序包后,Android Studio会引发未找到匹配的客户端的情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!