[英]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.