【问题标题】:Firebase Crashlytics do not sync with my android projectFirebase Crashlytics 不与我的 android 项目同步
【发布时间】:2018-08-24 14:33:42
【问题描述】:

我正在尝试在我的 android 项目中启动 Firebase Crashlytics,但由于某种原因,在真实设备中运行项目后,crashlytics 仪表板没有刷新,我无法通过此窗口,我也等待了几天但什么都没发生。
这是 build.gradle(Project):

buildscript {
repositories {
    jcenter()
    maven {
        url 'https://maven.google.com/'
        name 'Google'
    }
    maven {
        url 'https://maven.fabric.io/public'
    }
    google()
}
dependencies {
    //classpath 'com.android.tools.build:gradle:2.0.0'
    classpath 'com.android.tools.build:gradle:3.1.4'
    classpath 'com.google.gms:google-services:4.0.0'
    classpath 'io.fabric.tools:gradle:1.25.4'

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

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

    }
}

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

}

还有 build.gradle(Module):

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



android {
    signingConfigs {
    }
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    defaultConfig {
        multiDexEnabled true
        applicationId "com.example.example"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 2
        versionName '1.0.2'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
        }
    }
    productFlavors {
    }
}

dependencies {
    implementation project(':wheel-release')
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:customtabs:27.1.1'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.1.14'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation('com.facebook.android:facebook-android-sdk:4.5.0') {
        exclude module: 'bolts-android'
        exclude module: 'support-v4'
    }
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.dlazaro66.qrcodereaderview:qrcodereaderview:2.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-auth:16.0.2'
    implementation 'com.google.firebase:firebase-messaging:17.1.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.4'
    implementation 'com.google.firebase:firebase-appindexing:16.0.1'
    implementation fileTree(dir: 'libs', include: ['*.aar'])
    implementation 'com.android.support:support-v13:27.1.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    }
}
apply plugin: 'com.google.gms.google-services'

有什么想法吗?

【问题讨论】:

  • 如果没有发生崩溃,没有任何显示是正常的

标签: android firebase firebase-crash-reporting


【解决方案1】:

就我而言,我从 AndroidManifest 中删除了:

<meta-data
        android:name="io.fabric.ApiKey"
        android:value="API Key" />

【讨论】:

    【解决方案2】:

    之前

    AFAIK Fabric 已弃用。所以在我的情况下,添加这个元数据是可行的

    <meta-data 
       android:name="firebase_crashlytics_collection_enabled" 
       android:value="true" />
    

    之后:

    在AndroidManifest.xml中添加到哪里?

    <application>
        <meta-data/>
        <activity/>
    </application>
    

    【讨论】:

    • 嘿,还没更新,你能帮我吗?
    【解决方案3】:

    当我将 Firebase 崩溃报告更新到 Crashlytics 时,我遇到了同样的问题。

    试试这个:

    -从 Firebase 控制台更新您的 google-services.json 文件

    -将这些行添加到您的 AndroidManifest.xml

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

    -编辑后在您的应用中生成崩溃

    【讨论】:

      【解决方案4】:

      为了不“升级”到错误的方向:

      <meta-data android:name="firebase_crashlytics_collection_enabled" android:value="true"/>
      <meta-data android:name="firebase_crash_collection_enabled" android:value="false"/>
      <!-- <meta-data android:name="io.fabric.ApiKey" android:value=""/> -->
      

      【讨论】:

        【解决方案5】:

        添加到清单

        <meta-data 
        android:name="firebase_crashlytics_collection_enabled" 
        android:value="true" />
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2023-03-18
          • 2020-07-11
          • 2019-02-15
          • 2020-08-17
          • 2018-08-20
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多