[英]Blocked On Adding Enable Crashlytics to Android Firestore Project
我正在编写一个概念证明应用程序来演示将 Firestore 和 Crashlytics 添加到 Java Android 应用程序。
我首先编写了一个简单的 Firestore 项目,并且进展顺利。 然后我尝试添加 Crashlytics。 有一个步骤是“启用 Crashlytics”,当我点击它时,我会得到一个不停旋转的微调器。
我认为问题可能是在您第一次设置项目时需要添加 Crashlytics,所以我创建了一个新的 Google Cloud 项目,为 Firestore 设置它,然后尝试添加 Crashlytics,但遇到了同样的问题,Enable Crashlytics 永远旋转。
有人在 Google Firestore 组中发布了这个问题,完全相同的问题,但没有任何回应。
在 Google 文档中,启用 Crashlytics 步骤是在更新 gradle 文件之前,这表明对 Google 端 Firestore 项目启用 Crashlytics 不依赖于 gradle 文件。
谢谢,
沃伦
这是我的项目级别 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
}
这是我的应用程序级别 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'
我看到在您的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.