简体   繁体   English

Firebase Crashlytics 崩溃报告仅在应用程序在预发布测试中运行时出现

[英]Firebase Crashlytics crash reports only appearing when app runs in Pre-release testing

I have followed and triple-verified all of the setup steps for adding firebase & crashlytics to my app here: https://firebase.google.com/docs/android/setup?hl=en and here: https://firebase.google.com/docs/crashlytics/get-started?authuser=0&platform=android , verified that the google-services.json is correct (actually re-downloaded it for comparison, and it works for Firebase messaging).我已经按照并三重验证了在我的应用程序中添加 firebase 和 crashlytics 的所有设置步骤: https://firebase.google.com/docs/android/setup?hl=en和这里: Z5E056ZC500A1C47BADE751050A1C4BADE7 google.com/docs/crashlytics/get-started?authuser=0&platform=android ,验证了 google-services.json 是正确的(实际上是重新下载它以进行比较,它适用于 Firebase 消息传递)。 Enabled Analytics sharing.启用分析共享。 Crashlytics enabled for my app on Firebase console.在 Firebase 控制台上为我的应用启用了 Crashlytics。 Some json reports do get logged as uploaded at runtime (not crashes) with a 204 result, but on startup, the app gets an error "E/FirebaseCrashlytics: Settings request failed. java.io.FileNotFoundException: https://firebase-settings.crashlytics.com/spi/v2/platforms/android/gmp/(snip)&build_version=99&display_version=2022.08.31.99 blah blah blah" and then when I click on my "TEST CRASH" button, I get another error " E/FirebaseCrashlytics: Cannot send reports. Timed out while fetching settings.". Some json reports do get logged as uploaded at runtime (not crashes) with a 204 result, but on startup, the app gets an error "E/FirebaseCrashlytics: Settings request failed. java.io.FileNotFoundException: https://firebase-settings .crashlytics.com/spi/v2/platforms/android/gmp/(snip)&build_version=99&display_version=2022.08.31.99 blah blah blah”,然后当我单击“测试崩溃”按钮时,我收到另一个错误“E/FirebaseCrashlytics : 无法发送报告。获取设置时超时。”。

The thing is, the crash reports DO appear for crashes that occur during the Google Play Pre-Release testing upon upload to Google Play (closed testing), including for the "CRASH TEST" button, and then I get crash-free users, logs, stack trace, the whole thing.问题是,崩溃报告确实会出现在 Google Play 预发布测试期间上传到 Google Play(封闭测试)期间发生的崩溃,包括“崩溃测试”按钮,然后我得到无崩溃的用户,日志,堆栈跟踪,整个事情。 Because this part is working, it would appear that my setup is correct.因为这部分工作正常,所以我的设置似乎是正确的。

I have Proton VPN installed on the device, but have disabled it during testing.我在设备上安装了 Proton VPN,但在测试期间禁用了它。 It does not seem to matter.这似乎无关紧要。

NOTE: I cannot get the crash to upload whether the app was subsequently downloaded (beta) from Google Play or whether I compiled it, debug or release, in order to run it with Android Studio with USB debugging to the same device (but I have to uninstall one to install the other, and only the downloaded one has the option to "Report" the crash -- I don't know if the crash would ever be uploaded if I don't choose Report, but I have never seen a reported crash, in the Play Console, Firebase, or anywhere else.)注意:无论应用程序是随后从 Google Play 下载(测试版)还是我编译、调试或发布,我都无法上传崩溃,以便使用 Android Studio 和 USB 调试到同一设备运行它(但我有卸载一个安装另一个,只有下载的有“报告”崩溃的选项——我不知道如果我不选择报告,是否会上传崩溃,但我从未见过报告崩溃,在 Play 控制台、Firebase 或其他任何地方。)

Does anyone know how I can get crashes to be reported to Crashlytics outside of Pre-release testing?有谁知道我如何在预发布测试之外将崩溃报告给 Crashlytics? Are there any prerequisites like "app has to have been uploaded with the same version" or "no VPN allowed" or "'Report' must be selected in popup dialog on device after the crash" or "display version string must not contain spaces" or anything else?是否有任何先决条件,例如“应用程序必须以相同版本上传”或“不允许 VPN”或“崩溃后必须在设备上的弹出对话框中选择'报告'”或“显示版本字符串不得包含空格”还是别的什么? (From some things I have read even on the docs, it appeared I should be able to be testing a local build and get crash reports.) (从我什至在文档上阅读的一些内容来看,我似乎应该能够测试本地构建并获得崩溃报告。)

I am using the latest "Chipmunk" Studio.我正在使用最新的“Chipmunk”工作室。 I just updated to the latest firebase BOM.我刚刚更新到最新的 firebase BOM。

From my project-level build.gradle:从我的项目级 build.gradle:

buildscript {
    repositories {
        google()
        mavenCentral()
        maven {url "https://plugins.gradle.org/m2/" }
        maven { url "https://jitpack.io" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.2.2'
        //classpath 'com.google.android.gms:oss-licenses-plugin:0.9.5'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        //classpath 'com.github.jk1:gradle-license-report:1.9'
        classpath 'com.github.jk1:gradle-license-report:2.0'

        classpath 'com.google.gms:google-services:4.3.13'
        // Add the Crashlytics Gradle plugin
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'
    }
} ...

From my module-level build.gradle:从我的模块级 build.gradle:

plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
    id 'com.google.firebase.crashlytics'
}
...
    repositories {
        maven { url "https://jitpack.io" }
        mavenCentral()
    }

    dependencies {
        // Import the BoM for the Firebase platform
        implementation platform('com.google.firebase:firebase-bom:30.4.0')  // Bill Of Materials
        implementation 'androidx.appcompat:appcompat:1.4.2' // this is last version compatible with Android sdk 31
        implementation 'com.google.code.gson:gson:2.8.6'
        implementation 'com.squareup.retrofit2:retrofit:2.9.0'
        implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
        implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
        implementation 'androidx.navigation:navigation-ui:2.5.1'
        implementation "androidx.lifecycle:lifecycle-process:2.5.1"
        implementation 'androidx.lifecycle:lifecycle-common-java8:2.5.1'
        implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
        implementation 'org.jetbrains:annotations:15.0'
        implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
        implementation 'androidx.preference:preference:1.2.0'
        implementation 'androidx.biometric:biometric:1.1.0'
        implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
        implementation 'org.apache.commons:commons-math3:3.6.1'
        implementation 'com.github.drawers:SpinnerDatePicker:2.1.0'
        testImplementation 'junit:junit:4.13-beta-2'
        androidTestImplementation 'androidx.test:runner:1.4.0'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

        implementation 'ch.qos.logback:logback-classic:1.2.10'
        implementation 'ch.qos.logback:logback-core:1.2.10'
        implementation 'org.codehaus.janino:commons-compiler:3.1.6'

        // for in-app purchases (data service subscription)
        implementation 'com.android.billingclient:billing:5.0.0'

        // for message broadcasting, diagnostics & analytics
        // When using the BoM, you don't specify versions in Firebase library dependencies
        implementation 'com.google.firebase:firebase-analytics'
        implementation 'com.google.firebase:firebase-crashlytics'
        implementation 'com.google.firebase:firebase-messaging'
    }

In my main activity:在我的主要活动中:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 ...
        // Obtain the FirebaseAnalytics instance.
        mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
...

            // TODO remove in production
            addTestCrashButtonForCrashlytics();
...
    }

    private void addTestCrashButtonForCrashlytics() {
        Button crashButton = new Button(this);
        crashButton.setText("Test Crash");
        crashButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                throw new RuntimeException("Test Crash"); // Force a crash
            }
        });

My thanks in advance for anyone who can help me figure this out.我提前感谢任何可以帮助我解决这个问题的人。

Son of a..., After DAYS on this problem, I just found the answer - the issue is, actually.一个...的儿子,在解决这个问题的 DAYS 之后,我刚刚找到了答案 - 实际上,问题是。 that the display version had spaces in it, So, in the module level build.gradle: I had a descriptive versionName which explains in Google Play the latest summary of changes:显示版本中有空格,因此,在模块级别 build.gradle:我有一个描述性的版本名称,它在 Google Play 中解释了最新的更改摘要:

        versionName "2022.08.31.99 Blah, blah blah"

, which looked suspicious in the error "E/FirebaseCrashlytics: Settings request failed. java.io.FileNotFoundException: https://firebase-settings.crashlytics.com/spi/v2/platforms/android/gmp/(snip)&build_version=99&display_version=2022.08.31.99 blah blah blah", since URLs can't have spaces - so I tried changing it to just: , which looked suspicious in the error "E/FirebaseCrashlytics: Settings request failed. java.io.FileNotFoundException: https://firebase-settings.crashlytics.com/spi/v2/platforms/android/gmp/(snip)&build_version=99&display_version =2022.08.31.99 blah blah blah”,因为 URL 不能有空格 - 所以我尝试将其更改为:

        versionName "2022.08.31.99"

I recompiled it and ran it over USB on the phone, tapped the test crash button and got a crash report almost immediately.我重新编译它并在手机上通过 USB 运行它,点击测试崩溃按钮并几乎立即得到崩溃报告。 Backed it out, the problem occurs, put it back, it's working!退出它,出现问题,把它放回去,它正在工作! Hope this helps someone else!希望这对其他人有帮助!

By the way, this was working using a local debug build running over USB.顺便说一句,这是使用在 USB 上运行的本地调试版本来工作的。 Furthermore, it does not have to match an uploaded version in Google Play - I subsequently incremented it and it still reported a crash.此外,它不必与 Google Play 中上传的版本相匹配 - 我随后增加了它,但它仍然报告崩溃。 It does seem to have an issue over VPN (it might be the particular server, or maybe just not allowed on VPN.) These were crashes that automatically uploaded to Crashlytics - I did not have to choose "Report" on a popup, and actually, could not because they were local builds, which as I mentioned earlier, don't give that option.它似乎确实存在 VPN 问题(它可能是特定服务器,或者可能只是 VPN 不允许。)这些是自动上传到 Crashlytics 的崩溃 - 我不必在弹出窗口中选择“报告”,实际上,不能,因为它们是本地构建,正如我之前提到的,不提供该选项。

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

相关问题 如何在 Android 中强制 NDK 崩溃以在 firebase crashlytics 中进行测试? - How to force crash for NDK in Android for testing in firebase crashlytics? 崩溃中未出现 Crashlytics 自定义密钥 - Crashlytics custom key not appearing in crash Firebase Crashlytics 报告 iOS 应用程序崩溃 - Firebase Crashlytics reporting crash on iOS application Firebase Crashlytics 说 6 个事件,但只显示 2 个 - Firebase Crashlytics say 6 events,but only show 2 Firebase Crashlytics for Android app without inte.net connection - Firebase Crashlytics for Android app without internet connection 当 object 添加到 firebase - Android Studio 时,应用程序崩溃与 GC - App crash with GC When an object added to firebase - Android Studio Firebase Crashlytics 在手动启用时不报告崩溃 - Firebase Crashlytics not reporting crashes when manually enabled Flutter iOS 发布崩溃:Firebase FireStore Util - Flutter iOS Release Crash: Firebase FireStore Util 如何将我的应用程序与 Firebase Crashlytics 集成? 依赖性问题 - How I can integrate my app with Firebase Crashlytics? Problems with dependencies 如何使用 Firebase Crashlytics 对 Flutter 应用程序中的 Java 堆栈跟踪进行反混淆 - How to deobfuscate Java stacktrace in Flutter app with Firebase Crashlytics
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM