簡體   English   中英

Firebase 崩潰報告在 Firebase crashlytics 更新后未出現在 android 中

[英]Firebase Crash report not appearing in android after Firebase crashlytics update

在 Android 中更新 Firebase crashlytics 依賴項后,我無法查看崩潰報告。甚至我的 Firebase 控制台也顯示“您安裝了最新的 SDK”。 請參考我的構建細節。

build.gradle

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.2'
        classpath 'com.google.gms:google-services:4.3.4'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
    }
}

allprojects {
    repositories {
        google()
        mavenLocal()
        mavenCentral()
        maven {                                 
            url 'https://maven.google.com/'
            name 'Google'
        }
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle(:應用程序)

apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.crashlytics'

android {
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }

    compileSdkVersion 28

    defaultConfig {
        applicationId "com.XXX.XXX"
        minSdkVersion 16
        targetSdkVersion 28
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        renderscriptSupportModeEnabled true
        multiDexEnabled true
    }

    buildTypes {
        release {
            // signingConfig signingConfigs.release
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            // resValue "string", "app_name", "$app_name_release"
        }

        debug {
            applicationIdSuffix ".debug"
            versionNameSuffix "-debug"
            buildConfigField "String", "TYPE", '"DEBUG"'
        }
    }
    flavorDimensions "mode", "key"

    productFlavors {
        lite {
            dimension "mode"
            applicationId "com.xxx.xxx"
            versionCode 23
            versionName "4.4.3"
            manifestPlaceholders = [app_name: "Pro-Inspector"]
        }

        pi {
            dimension "mode"
            applicationId "com.xxx.xxx"
            versionCode 53
            versionName "4.4.3"
            manifestPlaceholders = [app_name: "Pro-Inspector"]
        }

        local {
            dimension "key"
        }

        sandbox {
            dimension "key"
        }

        demo {
            dimension "key"
        }

        dev {
            dimension "key"
        }

        production {
            dimension "key"
        }

        live {
            dimension "key"
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    variantFilter { variant ->
        def modeName = variant.flavors*.name
        def keyName = variant.flavors*.name

        // To check for a certain build type, use variant.buildType.name == "<buildType>"
        // Gradle ignores any variants that satisfy the conditions below

        if (modeName.contains("lnt") && keyName.contains("demo")) {
            setIgnore(true)
        }
        if (modeName.contains("pi") && keyName.contains("dev")) {
            setIgnore(true)
        }
        if (modeName.contains("pi") && keyName.contains("production")) {
            setIgnore(true)
        }
        if (modeName.contains("lnt") && keyName.contains("live")) {
            setIgnore(true)
        }
    }
}

dependencies {
    implementation 'com.google.firebase:firebase-crashlytics:17.2.2'
    implementation 'com.google.firebase:firebase-analytics:18.0.0'
    implementation 'com.google.firebase:firebase-core:18.0.0'
    implementation 'com.google.firebase:firebase-messaging:21.0.0'
    implementation 'com.google.firebase:firebase-auth:20.0.0'
    implementation 'com.google.firebase:firebase-messaging-directboot:21.0.0'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    // RETROFIT
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    // GLIDE
    implementation 'com.github.bumptech.glide:glide:4.3.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'
    // VIEWMODEL
    implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
    implementation 'androidx.lifecycle:lifecycle-viewmodel:2.0.0'
    api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'

    implementation 'org.greenrobot:eventbus:3.1.1'
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'com.google.android.material:material:1.1.0-alpha02'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.android.volley:volley:1.1.0'
    implementation 'com.daasuu:EasingInterpolator:1.0.0'
    implementation 'com.google.android.gms:play-services-vision:20.1.2'
    implementation 'com.google.android.gms:play-services-location:17.1.0'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'com.google.android.gms:play-services-identity:17.0.0'
    implementation 'com.google.android.gms:play-services-location:17.1.0'
    implementation 'com.google.android.gms:play-services-places:17.0.0'
    implementation 'org.adw.library:discrete-seekbar:1.0.1'
    implementation 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
    implementation 'com.nineoldandroids:library:2.4.0'
    implementation 'androidx.multidex:multidex:2.0.1'
    androidTestImplementation 'androidx.multidex:multidex:2.0.1'
    androidTestImplementation 'androidx.multidex:multidex-instrumentation:2.0.0'
    implementation 'commons-io:commons-io:2.0.1'
    testImplementation 'junit:junit:4.12'
    implementation project(':pdfviewer')

    //retrofit dependencies
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'androidx.lifecycle:lifecycle-viewmodel:2.2.0'
 
}
apply plugin: 'com.google.gms.google-services'

有人已經遇到過這個問題嗎? 誰能幫我查看控制台中的崩潰

我也遇到了同樣的問題,為了解決這個問題,我做了以下步驟。

  1. 添加新的 Crashlytics SDK 之后。 從 Firebase 控制台下載新的 Google-services.json 文件(您可以從 Firebase 控制台的項目設置中獲取)

  2. 第一次強制崩潰。

     throw new RuntimeException("Test Crash");
  3. 運行你的應用程序。它會崩潰,因為我們在運行時異常上面添加了。

現在檢查您的 Firebase 控制台。 你可以看到崩潰報告

請參閱此處

就我而言,我犯了一個愚蠢的錯誤:

FirebaseCrashlytics.getInstance().setUserId(uid);

其中uid仍然是 null。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM