Unity/Firebase-项目包ID与google-services.json文件中的任何包ID都不匹配
我正在Unity上制作一款手机游戏,Android优先 现在我正在集成firebase分析 在Firebase控制台上设置信息并将Unity/Firebase-项目包ID与google-services.json文件中的任何包ID都不匹配,firebase,unity3d,firebase-analytics,Firebase,Unity3d,Firebase Analytics,我正在Unity上制作一款手机游戏,Android优先 现在我正在集成firebase分析 在Firebase控制台上设置信息并将google services.json文件放入Unity项目后,Unity显示一个错误,说明: Project Bundle ID com.RetroSpirit.ToiletRush does not match any bundle IDs in your google-services.json files This will result in an app
google services.json
文件放入Unity项目后,Unity显示一个错误,说明:
Project Bundle ID com.RetroSpirit.ToiletRush does not match any bundle IDs in your google-services.json files
This will result in an app that will fail to initialize.
Available Bundle IDs:
You need to either:
* Fix your app's bundle ID under "Player Settings --> Bundle Identifier"
or:
* Add another app to your firebase project
Goto https://firebase.google.com/docs/unity/setup#add_firebase_to_your_app_1
and add the new configuration file to your project.
UnityEngine.Debug:LogError(Object)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:LogErrorIfEnabled(String)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:FindGoogleServicesFile(SortedDictionary`2, String, LogMessage, LogMessage)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:FindGoogleServicesFile(String, LogMessage, LogMessage)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:UpdateJson(Boolean, LogMessage, LogMessage)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:OnPostprocessAllAssets(String[], String[], String[], String[])
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])
UnityEditorInternal.InternalEditorUtility:ProjectWindowDrag(HierarchyProperty, Boolean)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
以下是google services.json
的一部分
"client": [
{
"client_info": {
"mobilesdk_app_id": "*:***********:android:****************",
"android_client_info": {
"package_name": "com.RetroSpirit.ToiletRush"
}
},
"oauth_client": [
{
"client_id": "***********-********************************.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.RetroSpirit.ToiletRush",
"certificate_hash": "****************************************"
}
我不知道我应该检查什么
项目包ID(构建设置-其他设置-标识上的包名称)与google services.json
中的包名称完全相同
有什么想法吗?回答我自己有点可笑 我偶然发现了问题的原因。我的VC运行时出现问题,因此
generate\u xml\u from\u google\u services\u json.exe
无法从google services.json
提取包名。(无法提取vc90.crt.manifest!)
不幸的是,尽管重新安装了很多Visual Studio、VC运行时和.net框架,我还是无法修复该运行时错误。最后我重新安装了Windows 10,问题就消失了。。。仍然不知道是什么导致了这个错误。回答我自己有点可笑 我偶然发现了问题的原因。我的VC运行时出现问题,因此
generate\u xml\u from\u google\u services\u json.exe
无法从google services.json
提取包名。(无法提取vc90.crt.manifest!)
不幸的是,尽管重新安装了很多Visual Studio、VC运行时和.net框架,我还是无法修复该运行时错误。最后我重新安装了Windows 10,问题就消失了。。。仍然不知道是什么原因导致此错误。我知道您已通过重新安装Windows解决了此问题,但这就是我在其他人遇到此问题时通过此问题的原因: 确保已在Unity player设置(编辑>项目设置>播放器>其他设置>标识>软件包名称)中设置软件包名称 设置为与您在Firebase中设置的相同(类似于com.CompanyName.ProductName)
确保已按此处所述将Firebase资源导入Unity项目,并且Firebase文件夹存在于资产>Firebase中。更改此文件夹的位置似乎会破坏一切。我知道您已通过重新安装Windows解决了此问题,但如果其他人遇到此问题,我就是这样解决此问题的: 确保已在Unity player设置(编辑>项目设置>播放器>其他设置>标识>软件包名称)中设置软件包名称 设置为与您在Firebase中设置的相同(类似于com.CompanyName.ProductName)
确保已按此处所述将Firebase资源导入Unity项目,并且Firebase文件夹存在于资产>Firebase中。更改此文件夹的位置似乎会破坏一切。在本例中,我们通过向具有管理员权限的同事请求一个新的google-services.json文件来解决问题。在本例中,我们通过向具有管理员权限的同事请求一个新的google-services.json文件来解决问题