Почему новые Firebase Crashlytics (без Fabri c) не работают в Android? - PullRequest
1 голос
/ 21 марта 2020

Все читают, прежде чем предлагать ответ, и обновлять себя (Не предлагайте Фабри c предложение): https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android

Мое приложение уже зарегистрировано в firebase.

Я все настраиваю, но ничего не изменяю в манифесте и классе приложения.

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

android {
    /* compileSdkVersion 'android-R'*/
    compileSdkVersion 29
    defaultConfig {
        applicationId "com.xxxxxxxxxxxx"
        minSdkVersion 21
        /* targetSdkVersion 'R'*/
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    lintOptions {
        checkReleaseBuilds true
        abortOnError false
    }

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        customDebugType {
            debuggable true
        }
    }

    dataBinding {
        enabled = true
    }
    useLibrary 'org.apache.http.legacy'
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.1.0'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    //Lifecycle components
    def life_versions = "2.2.0-beta01"

    implementation "android.arch.lifecycle:extensions:$life_versions"
    annotationProcessor "android.arch.lifecycle:compiler:$life_versions"

    //Server API Integration
    implementation 'com.squareup.retrofit2:retrofit:2.7.1'
    implementation 'com.squareup.retrofit2:converter-gson:2.7.1'
    implementation "com.squareup.okhttp3:logging-interceptor:4.4.0"
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.7.1'

    //For QR Scanner
    implementation 'com.google.android.gms:play-services-vision:19.0.0'

    //Show DB on Chrome
    implementation 'com.facebook.stetho:stetho:1.5.1'

    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
    implementation 'com.github.sundeepk:compact-calendar-view:1.7.8'
    implementation 'de.hdodenhof:circleimageview:3.1.0'
    implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    implementation 'com.google.firebase:firebase-analytics:17.2.3'
    implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta01'
}

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.0-beta03'
        classpath 'com.google.gms:google-services:4.3.3'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta02'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

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

это не работает, я попытался взломать sh мое приложение и проверил на консоли Firebase как ну

Обновление:

В консоли Firebase

To see this data, make sure your app has Google Analytics for Firebase and the latest Fabric SDK or Firebase Crashlytics SDK.

но я уже добавил

Ответы [ 3 ]

0 голосов
/ 21 марта 2020

Используйте это:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
// Add the Fabric plugin.
apply plugin: 'io.fabric'

dependencies {
    // ...

    // (Recommended) Add the Google Analytics dependency.
    implementation 'com.google.firebase:firebase-analytics:17.2.3'

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

Также добавьте это в свои репозитории buildscript:

maven { url 'https://maven.fabric.io/public' }
0 голосов
/ 02 апреля 2020

Во-первых, убедитесь, что ваши зависимости обновлены для Crashlytics:

// Add the Firebase Crashlytics SDK.
implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta03'
// Add the Firebase Crashlytics Gradle plugin.
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta03'

Похоже, вы используете одновременно beta01 и beta02, что может вызвать проблемы.

В противном случае, попробуйте включить режим отладки для Crashlytics, создать и запустить приложение, разбить его, перезапустить, а затем проверить журналы при повторном запуске, чтобы убедиться, что Firebase и Crashlytics запускаются правильно и что сбои отправляются на наши серверы.

Наконец, проверьте любые другие настройки gradle, которые у вас есть, на предмет любых старых зависимостей или конфигурации Fabri c, которые могут приводить к тому, что новый Firebase SDK не работает.

0 голосов
/ 21 марта 2020

попробуйте это, я надеюсь, что это сработает с вами.

dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        // Check for v3.1.2 or higher
        classpath 'com.google.gms:google-services:4.3.2'  // Google Services plugin

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

    }
...