![](/img/trans.png)
[英]Flutter run fail in andriod studio Caused by: java.lang.IllegalStateException: The Crashlytics build ID is missing
[英]Firebase Crashlytics - java.lang.IllegalStateException: The Crashlytics build ID is missing
根據 Firebase 的新版本,我們的應用程序中添加了 Crashlytics,應用程序在啟動時停止。
java.lang.RuntimeException:無法獲取提供程序 com.google.firebase.provider.FirebaseInitProvider:java.lang.IllegalStateException:缺少 Crashlytics 構建 ID。 當應用程序的構建配置中缺少 Crashlytics 工具時,就會發生這種情況。 請查看 Crashlytics 入門說明並確保您擁有有效的 Crashlytics 帳戶。
應用級 Gradle應用插件:'com.google.firebase.crashlytics'
實施 'com.google.firebase:firebase-crashlytics:17.1.1'
項目級 Gradle類路徑 'com.google.gms:google-services:4.3.3' 類路徑 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'
按照 Firebase 指南Firebase 指南中的步驟進行操作
但是早期的 Fabric 版本比當前版本好太多了。
任何幫助將不勝感激。
在應用程序級別的 build.gradle 中,添加以下導入apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
然后,在 gradle/wrapper/gradle-wrapper.properties 文件中,將您的 gradle 版本升級到 5.6.4
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
我曾經使用 gradle 5.1.1 運行我的應用程序並升級到版本 5.6.4 解決了我的問題
我希望它會幫助你!
如果有人對此問題仍有疑問,請嘗試在項目級別 gradle 中使用 crashlytics gradle 版本2.1.1
。 我這樣做解決了我的問題。
buildscript {
...
dependencies {
...
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'
}
}
這通常發生在插件apply plugin: 'com.google.firebase.crashlytics'
在build.gradle
應用程序級別中丟失時。
請加
classpath 'com.google.firebase:firebase-crashlytics-gradle:x.x.x'
到您項目的構建 gradle。 並且不要忘記將以下行添加到您的應用程序構建 gradle
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
}
如果您忘記在項目級別build.gradle
中包含classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
也會發生這種情況
buildscript {
repositories {
// Check that you have Google's Maven repository (if not, add it).
google()
}
dependencies {
// ...
// Check that you have the Google services Gradle plugin v4.3.2 or later
// (if not, add it).
classpath 'com.google.gms:google-services:4.3.8'
// Add the Crashlytics Gradle plugin
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
}
}
allprojects {
repositories {
// Check that you have Google's Maven repository (if not, add it).
google()
}
}
將下面的代碼添加到project/android/app/build.gradle
apply plugin: 'com.google.firebase.crashlytics'
添加這一行
implementation "com.google.firebase:firebase-iid"
這將解決這個問題
這里有兩個可能的修復...
First one which is less likely solution is to rearrange the order of plugins in your build.gradle project file and bring apply plugin: 'com.google.firebase.crashlytics'
right under the google-services top plugin call in your project's build.gradle file so that you在調用其他庫或應用所需的其他插件之前,請在頂部進行此安排 所以就像這樣
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
- 從 android 工作室 4.0 起開始的第二個解決方案是在您的計算機上編輯您的全局 gradle.propeties 文件安裝...
這是下面圖片的更清晰修復...(因為有些人可能認為這里討論的“ gradle.properties ”文件是AS項目中的文件,而不是全局文件。
從 PC gradle 安裝位置的“gradle.propeties”文件中刪除以下行
systemProp.http.proxyHost= systemProp.https.proxyHost= systemProp.https.proxyPort=80 systemProp.http.proxyPort=80
如下圖所示,這是gradle.propeties文件的典型文件位置
現在在您的項目和 VIOLA 中單擊重建...問題已解決
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.