【问题标题】:Android Crashlytics stuck at "Build and run your app"Android Crashlytics 卡在“构建并运行您的应用程序”
【发布时间】:2019-08-13 09:55:11
【问题描述】:

我完全按照教程 (https://firebase.google.com/docs/crashlytics/get-started?authuser=1&platform=android#android) 操作,但仍然无法在 firebase Crashlytics 上看到我的应用。这是我的配置:

在根目录build.gradle

  dependencies {
    classpath 'com.android.tools.build:gradle:3.4.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.2.0'
    classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
    classpath 'io.fabric.tools:gradle:1.31.0'
  }

在应用中build.gradle

...
apply plugin: "io.fabric"

...
//Firebase
  implementation 'com.google.firebase:firebase-core:17.0.1'
  implementation 'com.google.firebase:firebase-config:18.0.0'
  implementation 'com.google.firebase:firebase-analytics:17.0.1'
  implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'

在应用程序中

Fabric.with(this, Crashlytics());

我正在调试上构建和运行应用程序,但在我看到的日志中没有任何反应

I/CrashlyticsInitProvider:CrashlyticsInitProvider 跳过初始化

I/CrashlyticsCore:初始化 Crashlytics Core 2.7.0.33

我会错过什么?

【问题讨论】:

  • Crashlytics 不久前已迁移到 Firebase
  • 这正是我正在做的,firebase.google.com/docs/crashlytics/…
  • @ElJazouli,你添加了apply plugin: 'com.google.gms.google-services'吗?
  • 您应该将 Fabric.with(this, Crashlytics()); 替换为 FirebaseApp.initializeApp(this);
  • 你抛出异常了吗?

标签: android crashlytics-android


【解决方案1】:

对于面临类似问题的任何人,我已经寻找了很多小时并最终检查了合并的清单,并发现有一个第 3 方库实际上正在设置他们自己的 Crashlytics 配置,它会覆盖我的配置。所以也许可以调查一下。

我最终将此添加到我的清单中:

<meta-data
    tools:node="remove"
    android:name="io.fabric.ApiKey"/>

【讨论】:

    【解决方案2】:

    请参阅Firebase Crashlytics Docs

    第 1 步:将此代码添加到您的项目级 build.gradle 文件中

    buildscript {
    repositories {
        // Add the following repositories:
        google()  // Google's Maven repository
    
        maven {
           url 'https://maven.fabric.io/public'
        }
    }
    
    dependencies {
        // ...
    
        // Check for v3.1.2 or higher
        classpath 'com.google.gms:google-services:4.3.0'  // Google Services plugin
    
        // Add dependency
        classpath 'io.fabric.tools:gradle:1.31.0'  // Crashlytics plugin
    
    
    }
    }
    
    
    allprojects {
    // ...
    
    repositories {
       // Check that you have the following line (if not, add it):
       google()  // Google's Maven repository
       // ...
    }
    }
    

    第 2 步:将此代码添加到您的应用级 build.gradle 文件中

    apply plugin: 'io.fabric'
    
    dependencies {
    // ...
    
    // Check for v11.4.2 or higher
    implementation 'com.google.firebase:firebase-core:17.0.1'
    
    // (Recommended) Add Analytics
    implementation 'com.google.firebase:firebase-analytics:17.0.1'
    
    // Add dependency
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
    }
    

    确保您已添加 google-services.json 并在具有 google play 服务的物理设备或模拟器中运行您的应用程序。

    感谢 firebase 创建了如此有用的文档。

    【讨论】:

    • 奇怪,似乎不起作用我尝试了一切,我已经有了这个确切的设置,并且已经有了我的 google-services.json,因为我已经集成了 firebase,只是检查了文件是否已启动到目前为止,它是,所以真的不知道发生了什么,firebase console#crashlytics 卡在 Build and run your app
    【解决方案3】:

    我是 Fabric/Firebase 的 Zubair。您能否尝试在全新的模拟器上进行单独的构建和运行事件(他们之前没有安装/运行过这个应用程序)。如果问题仍然存在,请通过“support@fabric.io”与我们联系,并在电子邮件中包含应用名称/捆绑包 ID 和 Firebase 项目 ID。

    【讨论】:

    • 感谢您的支持!我实际上发现了一个覆盖我的配置的第 3 方库,将其删除。
    猜你喜欢
    • 2019-05-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-14
    • 1970-01-01
    • 2014-12-17
    • 1970-01-01
    相关资源
    最近更新 更多