f-miyu / Plugin.CloudFirestore

MIT License
121 stars 44 forks source link

Not able to initialize on android project. #17

Open asusralis opened 4 years ago

asusralis commented 4 years ago

I'm using 1.2.3 because it seems that the initialization method is missing on 2.0.

This is what my OnCreated looks like:

            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            Plugin.CloudFirestore.CloudFirestore.Init(Application.Context);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            LoadApplication(new App());

And the error at the CloudFirestore.Init line:

Java.Lang.NullPointerException: 'Attempt to read from field 'java.lang.String com.google.firebase.FirebaseOptions.applicationId' on a null object reference'

I have Xamarin.Firebase.Firestore and this nuget on the android project and this nuget on my core project. Thanks!