【问题标题】:issues in implementing firebase crash analytics实施 Firebase 崩溃分析的问题
【发布时间】:2021-10-18 06:20:07
【问题描述】:

我正在尝试为我的 android 应用程序实现 firebase 崩溃分析,我添加了如 firebase 站点中所示的依赖项,我还添加了 googleservices.json。现在,在进行更改后,我安装了我的地图,但它崩溃了。

我附上了logcat的截图。请帮帮我。

应用的build.gradle

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

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.1"

    defaultConfig {
        applicationId "com.android.quotesapp"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

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

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.6.0'
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
    implementation 'com.android.support:design:28.0.0'
    implementation("androidx.recyclerview:recyclerview:1.2.1")
    // For control over item selection of both touch and mouse driven selection
    implementation("androidx.recyclerview:recyclerview-selection:1.1.0")
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation("com.android.volley:volley:1.2.0")
    implementation "androidx.cardview:cardview:1.0.0"
    implementation platform('com.google.firebase:firebase-bom:28.3.1')
    implementation 'com.google.firebase:firebase-analytics-ktx'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.firebase:firebase-core:19.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'


}

【问题讨论】:

  • 添加一些代码示例,从那里你得到这个崩溃
  • @AvinashKumarSingh 应用程序在打开后崩溃
  • 添加一些有问题的代码实现,只有我才能知道你做错了什么
  • @AvinashKumarSingh 我不知道要添加什么代码
  • @AvinashKumarSingh 执行 firebase 崩溃分析后发生错误,只需指出 logcat 代码中的任何部分,我将共享代码

标签: android firebase crashlytics android-app-indexing


【解决方案1】:

在你的 gradle 文件中添加以下内容:

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

之后

buildFeatures {

} 

添加

compileOptions {
     sourceCompatibility JavaVersion.VERSION_1_8
     targetCompatibility JavaVersion.VERSION_1_8
}

同时添加

implementation 'com.google.firebase:firebase-crashlytics:17.0.0'

如果你还没有添加,也在你的项目 build.gradle 中

classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0'

在依赖项中然后这样做

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-01-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-25
    • 1970-01-01
    相关资源
    最近更新 更多