Firebase Crashlytics与Fabric Crashlytics

时间:2019-01-02 16:42:57

标签: android firebase crashlytics

在这篇文章之后,我正在整合Crashlytics https://firebase.google.com/docs/crashlytics/get-started

这是我的项目级别gradle

buildscript {

    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.2.0'
        // Add dependency
        classpath 'io.fabric.tools:gradle:1.27.0'
    }
}

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

    }
}

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

// Define versions in a single place
ext {
    // Sdk and tools
    minSdkVersion = 16
    targetSdkVersion = 28
    compileSdkVersion = 28
    // App dependencies
    supportLibraryVersion = '27.1.1'
    sqlbriteVersion = '0.7.0'
    rxjavaVersion = '2.0.8'
    rxandroidVersion = '2.0.1'
    retrofitVersion = '2.3.0'
    daggerVersion = '2.11'
    playServicesVersion = '16.0.0'
    constraintLayoutVersion='2.0.0-alpha2'
    roomVersion = '1.0.0'
    picassoVersion = '2.5.2'
    flexboxVersion = '0.3.2'
    firebaseMessagingVersion='17.3.4'
    firebaseCoreVersion='16.0.6'
    crashlyticsVersion='2.9.8'
}

这是我的应用级别的礼物

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.seed.app"
        minSdkVersion 17
        targetSdkVersion 26
        multiDexEnabled  true
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')

    //dagger
    compile "com.google.dagger:dagger:$rootProject.daggerVersion"
    annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"
    compile "com.google.dagger:dagger-android:$rootProject.daggerVersion"
    compile "com.google.dagger:dagger-android-support:$rootProject.daggerVersion"

    implementation 'com.android.support:multidex:1.0.3'


    //firebase
    implementation "com.google.firebase:firebase-messaging:$rootProject.firebaseMessagingVersion"
    implementation "com.google.firebase:firebase-core:$rootProject.firebaseCoreVersion"

    // Crashlytics
    implementation "com.crashlytics.sdk.android:crashlytics:$rootProject.crashlyticsVersion"

}
repositories {
    mavenCentral()
}


apply plugin: 'com.google.gms.google-services'

这就是我在MainActivity中崩溃应用程序的方式。

Crashlytics.getInstance().crash();

我无法在Firebase控制台中获得任何错误,也无法在日志中获得错误消息

2019-01-02 20:36:55.139 21274-21274/com.seed.app E/CrashlyticsCore: This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
    install an Android build tool and ask a team member to invite you to this app's organization.

我的crashlytics安装必须与Fabric一起做什么?

1 个答案:

答案 0 :(得分:1)

通过将我的应用程序gradle中的apply插件重新定位到

,我能够使它正常工作
"a1" | "a2"