When you want to use Crashlytics NDK, you need call Fabric.with(this, new Crashlytics(),new CrashlyticsNdk());
But Firebase Crashlytics calls
Fabric.with(context, new Kit[]{new Crashlytics()});
on startup.
As the result you cannot use Crashlytics NDK.
How can I avoid this problem?
public class CrashlyticsInitProvider extends ContentProvider {
private static final String TAG = "CrashlyticsInitProvider";
public CrashlyticsInitProvider() {
}
public boolean onCreate() {
Context context = this.getContext();
FirebaseInfo firebaseInfo = new FirebaseInfo();
CrashlyticsInitProvider.EnabledCheckStrategy enabledCheckStrategy = new ManifestEnabledCheckStrategy();
if (this.shouldInitializeFabric(context, firebaseInfo, enabledCheckStrategy)) {
try {
Fabric.with(context, new Kit[]{new Crashlytics()}); // !here
Fabric.getLogger().i("CrashlyticsInitProvider", "CrashlyticsInitProvider initialization successful");
} catch (IllegalStateException var5) {
Fabric.getLogger().i("CrashlyticsInitProvider", "CrashlyticsInitProvider initialization unsuccessful");
return false;
}
}
return true;
}