Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Crashlytics stuck at "Build and run your app"

I followed the tutorial exactly (https://firebase.google.com/docs/crashlytics/get-started?authuser=1&platform=android#android) and still can't see my app on firebase Crashlytics. here's my configuration:

in root build.gradle

  dependencies {
    classpath 'com.android.tools.build:gradle:3.4.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.2.0'
    classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
    classpath 'io.fabric.tools:gradle:1.31.0'
  }

in app build.gradle

...
apply plugin: "io.fabric"

...
//Firebase
  implementation 'com.google.firebase:firebase-core:17.0.1'
  implementation 'com.google.firebase:firebase-config:18.0.0'
  implementation 'com.google.firebase:firebase-analytics:17.0.1'
  implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'

in Application

Fabric.with(this, Crashlytics());

I'm building and running the app on debug but nothing is happening, in the logs I see

I/CrashlyticsInitProvider: CrashlyticsInitProvider skipping initialization

I/CrashlyticsCore: Initializing Crashlytics Core 2.7.0.33

what could I be missing?

like image 563
TootsieRockNRoll Avatar asked Mar 03 '23 14:03

TootsieRockNRoll


2 Answers

For anyone who is facing a similar issue, I have looked for many hours and eventually checked the merged manifest and figured there is a 3rd party library that was actually setting up their own Crashlytics config which overrides mine. So maybe look into that.

I eventually added this to my manifest:

<meta-data
    tools:node="remove"
    android:name="io.fabric.ApiKey"/>
like image 97
TootsieRockNRoll Avatar answered Mar 17 '23 12:03

TootsieRockNRoll


Refer to the Firebase Crashlytics Docs.

Step 1: Add this code in your project level build.gradle file

buildscript {
repositories {
    // Add the following repositories:
    google()  // Google's Maven repository

    maven {
       url 'https://maven.fabric.io/public'
    }
}

dependencies {
    // ...

    // Check for v3.1.2 or higher
    classpath 'com.google.gms:google-services:4.3.0'  // Google Services plugin

    // Add dependency
    classpath 'io.fabric.tools:gradle:1.31.0'  // Crashlytics plugin


}
}


allprojects {
// ...

repositories {
   // Check that you have the following line (if not, add it):
   google()  // Google's Maven repository
   // ...
}
}

Step 2 : Add this code in your app-level build.gradle file

apply plugin: 'io.fabric'

dependencies {
// ...

// Check for v11.4.2 or higher
implementation 'com.google.firebase:firebase-core:17.0.1'

// (Recommended) Add Analytics
implementation 'com.google.firebase:firebase-analytics:17.0.1'

// Add dependency
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
}

Make sure you have added google-services.json and running your app in physical device or emulator having google play services.

credit goes to firebase for creating such a helpful docs.

like image 42
xaif Avatar answered Mar 17 '23 14:03

xaif