FirebaseAuth.getInstance() crashes with “IllegalArgumentException: Given String is empty or null”

守給你的承諾、 提交于 2019-12-06 14:12:11

This exception can be caused by a misconfigured google-services.json file. The error will occur if the api_key is missing. Verify that your google-services.json file contains this section:

  "api_key": [
    {
      "current_key": "AIzaSyDkG-g8hH7T4TV7RrN23ccnRsXp12345678" //<-- your key here
    }
  ],

If it does not, regenerate google-services.json.

Make sure you have used the plugin: apply plugin: 'com.google.gms.google-services'

Some conflicts can occur with libraries such as 'com.google.android.gms: play-services-maps: 16.0.0', and in this case the plug-in is often removed as a solution, and in the case I identified, this was the problem. Take a test without the play-services libraries.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!