简体   繁体   English

将 Enable Crashlytics 添加到 Android Firestore 项目时被阻止

[英]Blocked On Adding Enable Crashlytics to Android Firestore Project

I'm writing a proof of concept application to demonstrate adding Firestore and Crashlytics to a Java Android Application.我正在编写一个概念证明应用程序来演示将 Firestore 和 Crashlytics 添加到 Java Android 应用程序。

I first wrote a simple Firestore project and that went smoothly.我首先编写了一个简单的 Firestore 项目,并且进展顺利。 I then tried to add Crashlytics.然后我尝试添加 Crashlytics。 There is a step where you "Enable Crashlytics", when I click on that, I get a spinner that spins endlessly.有一个步骤是“启用 Crashlytics”,当我点击它时,我会得到一个不停旋转的微调器。

I thought perhaps the issue was that Crashlytics needs to be added when you first setup the project so I created a new Google Cloud project, set it up for Firestore, then tried to add Crashlytics but got the same issue, the Enable Crashlytics spins forever.我认为问题可能是在您第一次设置项目时需要添加 Crashlytics,所以我创建了一个新的 Google Cloud 项目,为 Firestore 设置它,然后尝试添加 Crashlytics,但遇到了同样的问题,Enable Crashlytics 永远旋转。

Someone posted this issue in a Google Firestore group, exact same issue, but there are no responses.有人在 Google Firestore 组中发布了这个问题,完全相同的问题,但没有任何回应。

In the Google documentation the Enable Crashlytics step is before updating the gradle files suggesting that Enabling Crashlytics to the Google side Firestore project is not dependent on the gradle files.在 Google 文档中,启用 Crashlytics 步骤是在更新 gradle 文件之前,这表明对 Google 端 Firestore 项目启用 Crashlytics 不依赖于 gradle 文件。

Thank you,谢谢,

Warren沃伦

Here is my project level gradle file:这是我的项目级别 gradle 文件:

 buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.1.0"
        classpath 'com.google.gms:google-services:4.3.8'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.6.1'

        // 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
}

here is my app level gradle这是我的应用程序级别 gradle

plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
    id 'com.google.firebase.crashlytics'
}
apply plugin: 'com.google.gms.google-services'
android {
    compileSdkVersion 30
    buildToolsVersion "30.0.2"

    defaultConfig {
        applicationId "com.warrendixon.crashlytics"
        minSdkVersion 23
        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'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'com.google.firebase:firebase-firestore:21.4.0'
    implementation platform('com.google.firebase:firebase-bom:28.0.1')
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-crashlytics'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

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

I see that in your app/build.gradle file you have two times apply plugin: 'com.google.gms.google-services' but no apply plugin: 'com.google.firebase.crashlytics' , so I suggest removing one and adding the crashlytics one, as stated on the oficial documentation .我看到在您的app/build.gradle文件中有两次apply plugin: 'com.google.gms.google-services'但没有apply plugin: 'com.google.firebase.crashlytics' ,所以我建议删除一个并如官方文档中所述,添加 crashlytics 之一。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM