[英]No matching client found for package name 'com.example.myapp '
[英]Execution failed for task ':app:processDebugGoogleServices'. > No matching client found for package name 'com.example.myapp '
找不到与 package 名称“com.example.myapp”匹配的客户端
这是来自 Google Service.json 的客户端部分
“客户端”:[https://stackoverflow.com/questions/66766493/execution-failed-for-task-appprocessdebuggoogleservices-no-matching-clien {
"client_info": {
"mobilesdk_app_id": "1:110944006455:android:f790b09ad0563a63046ab2",
"android_client_info": {
"package_name": "com.example.myapp"
}
}
这是我的 build.gradle
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.riderapp "
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
您可以看到两者的应用程序 ID 相同。 然而我收到了这个错误:
:app:processDebugGoogleServices
找不到与 package 名称“com.example.myapp”匹配的客户端
两者的应用程序 ID 不同。 在谷歌服务 json 它说com.example.myapp
但在你的 buildGradle 中它是com.example.riderapp
Go to firebase, add your app again with the name used in buildGradle com.example.riderapp
, add your SHA-1 debug key to firebase in this step also, then download your json again and remove the old one. 并报告发生了什么。
注意:确保将新的 googlejson 命名为
google-services.json
在 app/build.gradle 中将 minSdkVersion 更改为 21,并将项目中的每个“com.example.anything”更改为您的项目 ID(您可以在 firestore 的项目详细信息中找到它)
解决方案:正如@Huthaifa Muayyad所说的应用程序ID不一样,您可以按照他说的做或更直接的方法是将google-services.json中的“package_name”更改为“com.example.riderapp”,
原因:当你和你的队友共享你的项目时会出现这个错误,而你的队友可能有不同的项目名称,所以我们需要将 package_name 更改为我们的项目名称。
即使在此之后,也可能会出现错误,如“错误:D8:无法将请求的类放入单个 dex 文件中(# 方法:97652 > 65536)com.android.builder.dexing.DexArchiveMergerException:合并 dex 存档时出错:合并 dex 存档时出错a.dex 文件中的方法引用不能超过 64K。” 您可以按照此答案D8 中的说明解决此问题:Cannot fit requested classes in a single dex file by @king mort
Your Android [React Native] Project Bundle id is different from firebase project bundle ID, Create new app on firebase or change your app local bundle id with same as it is on firebase
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.