7

I am currently migrating an app from Fabric to Firebase Crashlytics and after updating all the different libraries as stated in the official documentation, I am getting a log message stating that the Crashlytic initialization has been skipped:

09-12 10:13:40.120 19176-19176/com.random.migratedApp I/CrashlyticsInitProvider: CrashlyticsInitProvider skipping initialization

And the app is not able to connect to the Firebase console.

After battling the code for some hours I decided to make a quick app from scratch to see if there was an problem with either my system or the libraries, but everything worked perfectly, getting a correct initialization and being able to see the crashes in the Firebase console.

09-12 10:11:31.852 18414-18414/com.test.appFromScratch I/CrashlyticsCore: Initializing Crashlytics Core 2.7.0.33
09-12 10:11:31.897 18414-18414/com.test.appFromScratch I/CrashlyticsInitProvider: CrashlyticsInitProvider initialization successful

I am wondering if I might have an incompatibility with one of the dependencies that might prevent Crashlytics from successfully initializing but I couldn't figure out what the problem might be here. Here you can see my list of dependencies for the app:

ext {
     playServicesLibrary = '17.0.0'
     glideLibrary = '4.8.0'
     androidXDependencies = [
        androidXAnnotation: "androidx.annotation:annotation:1.0.0",
        constraintLayout  : 'androidx.constraintlayout:constraintlayout:1.1.2',
        vectorDrawable    : "androidx.vectordrawable:vectordrawable:1.0.0",
        recyclerView      : "androidx.recyclerview:recyclerview:1.0.0",
        roomRuntime       : 'androidx.room:room-runtime:2.1.0-rc01',
        androidXV13       : "androidx.legacy:legacy-support-v13:1.0.0",
        preference        : "androidx.preference:preference:1.1.0-alpha04",
        customtabs        : "androidx.browser:browser:1.0.0",
        appCompat         : "androidx.appcompat:appcompat:1.0.0",
        cardView          : "androidx.cardview:cardview:1.0.0",
        design            : "com.google.android.material:material:1.0.0-rc01"
     ]
     volley = [
        volleyLib       :  "com.android.volley:volley:1.0.0"
     ]
     googleDependencies = [
        firebaseJobDispatcher   :  "com.firebase:firebase-jobdispatcher:0.8.5",
        firebaseAnalytics       :  "com.google.firebase:firebase-analytics:17.2.0",
        firebaseMessaging       :  "com.google.firebase:firebase-messaging:19.0.0",
        googleMapsUtils         :  "com.google.maps.android:android-maps-utils:0.4.4",
        googleAnalytics         :  "com.google.android.gms:play-services-analytics:${playServicesLibrary}",
        googleLocation          :  "com.google.android.gms:play-services-location:${playServicesLibrary}",
        firebaseCore            :  "com.google.firebase:firebase-core:17.2.0",
        crashlytics         :  "com.crashlytics.sdk.android:crashlytics:2.10.1",
        googleMaps              :  "com.google.android.gms:play-services-maps:${playServicesLibrary}",
        billing                 :  "com.android.billingclient:billing:1.1"
     ]
     otherDependencies = [
        glideAnnotations  :  "com.github.bumptech.glide:annotations:${glideLibrary}",
        bottomNavigation  :  "com.aurelhubert:ahbottomnavigation:2.1.0",
        scaleImageView    :  "com.davemorrissey.labs:subsampling-scale-image-view:3.6.0",
        debugDatabase     :  "com.amitshekhar.android:debug-db:1.0.6",
        taptargetview     :  "com.getkeepsafe.taptargetview:taptargetview:1.12.0",
        actionButtons     :  "com.nightonke:boommenu:2.1.1",
        threetenabp       :  "com.jakewharton.threetenabp:threetenabp:1.1.0",
        glideOkHttp       :  "com.github.bumptech.glide:okhttp3-integration:${glideLibrary}",
        cookieBar         :  "org.aviran.cookiebar2:cookiebar2:1.1.2",
        eventBus          :  "org.greenrobot:eventbus:3.1.1",
        facebook          :  "com.facebook.android:facebook-android-sdk:5.0.1",
        multidex          :  'androidx.multidex:multidex:2.0.0',
        apache            :  "org.apache.commons:commons-lang3:3.7",
        semver            :  "com.vdurmont:semver4j:2.0.1",
        zXing             :  "me.dm7.barcodescanner:zxing:1.9.8",
        glide             :  "com.github.bumptech.glide:glide:${glideLibrary}",
        io                :  "commons-io:commons-io:2.6"
     ]
newLogin = [
        circleimageview : "de.hdodenhof:circleimageview:2.1.0",
        romandanylyk    : "com.romandanylyk:pageindicatorview:0.2.0",
        interceptor     : "com.squareup.okhttp3:logging-interceptor:3.6.0",
        calligraphy     : "uk.co.chrisjenx:calligraphy:2.2.0",
        retrofit        : "com.squareup.retrofit2:converter-gson:2.3.0",
        intuit          : "com.intuit.sdp:sdp-android:1.0.4",
        okhttp          : "com.squareup.okhttp3:okhttp:3.6.0",
     ]
allDependencies = [
        full:[
                androidXDependencies.androidXAnnotation,
                androidXDependencies.constraintLayout,
                androidXDependencies.vectorDrawable,
                androidXDependencies.recyclerView,
                androidXDependencies.roomRuntime,
                androidXDependencies.androidXV13,
                androidXDependencies.preference,
                androidXDependencies.customtabs,
                androidXDependencies.appCompat,
                androidXDependencies.cardView,
                androidXDependencies.design,
                volley.volleyLib,
                googleDependencies.firebaseJobDispatcher,
                googleDependencies.firebaseMessaging,
                googleDependencies.googleAnalytics,
                googleDependencies.googleMapsUtils,
                googleDependencies.googleLocation,
                googleDependencies.firebaseCore,
                googleDependencies.firebaseAnalytics,
                googleDependencies.googleMaps,
                googleDependencies.billing,
                otherDependencies.glideAnnotations,
                otherDependencies.bottomNavigation,
                otherDependencies.scaleImageView,
                otherDependencies.actionButtons,
                otherDependencies.taptargetview,
                otherDependencies.glideOkHttp,
                otherDependencies.threetenabp,
                otherDependencies.cookieBar,
                otherDependencies.facebook,
                otherDependencies.eventBus,
                otherDependencies.multidex,
                otherDependencies.semver,
                otherDependencies.zXing,
                otherDependencies.apache,
                otherDependencies.glide,
                otherDependencies.io,
                newLogin.circleimageview,
                newLogin.calligraphy,
                newLogin.interceptor,
                newLogin.retrofit,
                newLogin.romandanylyk,
                newLogin.intuit,
                newLogin.okhttp,
                googleDependencies.crashlytics
        ],
        debugDependencies:[
                otherDependencies.debugDatabase
        ]
    ]
}

Cheers!

PayToPwn
  • 1,238
  • 1
  • 16
  • 29
  • you're using quite some outdated and even obsolete dependencies... and two HTTP clients. – Martin Zeitler Sep 12 '19 at 14:18
  • I am looking into it - I've found a fix that makes it work but I want to identify all the possible issues with the different dependencies. – PayToPwn Sep 13 '19 at 11:29

4 Answers4

6

After some trial and error, I find out that some of the libraries I am using might have a dependency to Crashlytics.

Adding this:

<meta-data
    tools:node="remove"
    android:name="io.fabric.ApiKey"/>

inside the <application> tag in the AndroidManifest.xml file.

Cheers!

PayToPwn
  • 1,238
  • 1
  • 16
  • 29
2

I did remove

<meta-data
   tools:node="remove"
   android:name="previous_api_key"/>

from manifest and problem fixed, that was for old version of crashlytics.

Hossein
  • 797
  • 1
  • 8
  • 24
0

Fabric/Firebaser here -

If you're migrating an app from Fabric to Firebase, there are no code changes required - you can simply follow the click-through migration flow and your app with its Crashlytics data will appear in your Firebase console.

If you're in a state where you have mixed integration, meaning you have a Fabric app and started changing dependencies while following the Firebase Crashlytics documentation, you should either

  1. remove all the references to Fabric (API key, build.gradle dependencies, initialization code) and onboard a fresh app with Firebase Crashlytics, or
  2. remove any Firebase changes you've made to get back to your old Fabric setup, and follow the migration flow linked above.
Kevin Kokomani
  • 1,568
  • 7
  • 14
  • Hi Kevin, I have followed all the steps from the migration, and creating a project from scratch works perfectly. The problem I have right now is that there's one or more libraries that might been relying in older crashlytics dependencies. I had found a workaround at the moment but as @martin-zeitler was commenting, I want to detect them and either update or delete them. – PayToPwn Sep 13 '19 at 08:10
0

First, you need to check there is internet available from both the side. (Consol and mobile) Then check any Crashlytics already plugin or implemented in the Gradle file if available then delete or remove it first after that try again it will work

Shaikh Mohib
  • 278
  • 3
  • 11