Why is Fabric not initialized? java.lang.IllegalStateException: Must Initialize Fabric before using singleton()

后端 未结 8 608
误落风尘
误落风尘 2021-02-06 22:26

I set up Firebase Crashlytics according to Get started with Firebase Crashlytics for my Android app (using Android studio 3.1.3). On my own device as well as on the Emulator, ev

8条回答
  •  孤街浪徒
    2021-02-06 23:03

    You need to initialize Crashlytics in your application's onCreate

    import android.app.Application;
    
    import com.crashlytics.android.Crashlytics;
    
    import io.fabric.sdk.android.Fabric;
    
    public class TestApplication extends Application {
        @Override
        public void onCreate() {
            super.onCreate();
            Fabric.with(this, new Crashlytics());
        }
    }
    

提交回复
热议问题