英文:
Flutter firebase has different app name than the project
问题
我正在设置Google身份验证(Google登录)。
我已经将我的调试SHA1添加到Firebase设置中。
不幸的是,我遇到了异常com.google.android.gms.common.api.ApiException: 10:
我注意到Firebase中的包名是com.example.xxx
,而应用中是com.xxx.xxx
,顺便说一下,当我下载google-services.json
时,我必须更改以匹配com.xxx.xxx
才能编译和运行。
所以问题是:您认为包名不匹配是问题的根本原因吗?我如何在Firebase设置中更改它?
英文:
I am setting up Google authentication (google sign in).
I added my debug SHA1 to the firebase settings.
Unfortunately, I get the exception com.google.android.gms.common.api.ApiException: 10:
I noticed that the package name in Firebase is com.example.xxx
whilst in the app is com.xxx.xxx
and by the way, when I download the google-services.json
, I have to change to match com.xxx.xxx in order to compile and run.
So the question is: do you think that the package name mismatch is the source of the issue? And how can I change it in the Firebase settings?
答案1
得分: 0
这绝对是问题所在。
所以要做的就是在Firebase中添加一个新的应用程序,并这次提供正确的包名称。
拥有同一平台的多个应用程序并不会有害,所以没问题。
一旦应用程序创建完成,只需下载Google服务文件并替换您项目中以前的文件。
完成后,只需重新构建项目,一切都会正常进行。
当您确认一切正常后,只需从Firebase仪表板中删除以前的应用程序,因为它现在没有用了。
英文:
That is definitively the problem.
So what to do is simply add a new app in Firebase and provide the right bundle name this time.
This isn't harmful to have multiple app of the same platform, so no problem.
Once the app is created, just download the google service file and replace the former you had in your project.
Once done, just rebuild the project and everything goes fine.
When yo witnessed that everything is ok, simply remove the former app from your Firebase dashboard as it is useless now.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论