FirebaseApp.initializeApp(Context); Android error;

前端 未结 3 1594
青春惊慌失措
青春惊慌失措 2021-01-25 08:23

I\'ve spent about three days now trying to solve a java error that\'s stopping me from finishing my chat app! And of course it\'s a firebase error! I\'m new to Android Developin

3条回答
  •  面向向阳花
    2021-01-25 09:18

    I had this issue. I built the generated android project in the platform in android studio then I found the issue and solved this.

    Follow this steps.

    Inside the platforms folder, android/src/{package name}/MainActivity.java

    Import the firebase library, * import com.google.firebase.FirebaseApp;

    Inside the oncreate method, below super.oncreate(savedinstancestate),

    Add FirebaseApp.initializeApp(this);

    Last step,

    Inside the platforms folder, android/res/values/string.xml,

    Add
***

    *** can be found in the googleservice.json file
"client": [
{
"client_info": {
"mobilesdk_app_id": this value


    Ref (for more detail): https://github.com/arnesson/cordova-plugin-firebase/issues/142

提交回复
热议问题