【问题标题】:Bugsnag: Error uploading source mappings?Bugsnag:上传源映射时出错?
【发布时间】:2018-11-18 10:42:36
【问题描述】:

我正在尝试将源映射上传到 Bugsnag,以便在发生错误时查看完整的堆栈跟踪,而不是捆绑文件的堆栈跟踪。我按照this 页面上的说明进行操作,但在尝试构建 APK 时出现此错误:

> Task :app:uploadBugsnagReleaseMapping
Mapping file not found: null

我查看了我的android\app\build.gradle 文件并注意到minifiedEnabled 属性设置为false。我把它改成true,然后错误改成:

Mapping file not found: C:\Development\React Native Practise\bugsnag_practise\android\app\build\outputs\mapping\release\mapping.txt

我认为我需要手动添加文件,所以我在该目录中添加了一个具有该名称的空文本文件并得到了这个:

Attempting upload of mapping file to Bugsnag
Bugsnag upload failed with code 422: Received empty file
Retrying Bugsnag upload (1/5) ...
Attempting upload of mapping file to Bugsnag
Bugsnag upload failed with code 422: Received empty file
Retrying Bugsnag upload (2/5) ...
Attempting upload of mapping file to Bugsnag
Bugsnag upload failed with code 422: Received empty file
Retrying Bugsnag upload (3/5) ...
Attempting upload of mapping file to Bugsnag
Bugsnag upload failed with code 422: Received empty file
Retrying Bugsnag upload (4/5) ...
Attempting upload of mapping file to Bugsnag
Bugsnag upload failed with code 422: Received empty file
Retrying Bugsnag upload (5/5) ...
Attempting upload of mapping file to Bugsnag
Bugsnag upload failed with code 422: Received empty file

如果有帮助,这是我在android\app\build.gradle 中的错误配置:

bugsnag {
    autoUpload true
    ndk false
    autoReportBuilds true
    autoProguardConfig true
    overwrite true
    retryCount 5
}

和我的 buildTypes 配置在同一个文件中:

buildTypes {
    release {
        signingConfig signingConfigs.release
        minifyEnabled enableProguardInReleaseBuilds
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    }
}

是否缺少将填充此文件的配置选项?

【问题讨论】:

    标签: android react-native bugsnag


    【解决方案1】:

    您需要在app/proguard-rules.pro 中禁用混淆

    # Disabling obfuscation is useful if you collect stack traces from production crashes
    # (unless you are using a system that supports de-obfuscate the stack traces).
    # Disable to generate mapping.txt Enable for production apk
    -dontobfuscate <- Comment this line
    

    然后再试一次

    【讨论】:

    • 我将此标记为正确,-printmapping obfuscate/mapping.txt 表示该文件已创建并填充了数据。
    • 当我注释掉该行时,我不断收到同样的错误。我也尝试添加'-printmapping obfuscate/mapping.txt',但仍然是同样的错误。
    猜你喜欢
    • 2023-02-02
    • 2018-06-22
    • 1970-01-01
    • 2017-09-15
    • 2023-03-29
    • 1970-01-01
    • 2013-03-03
    • 2014-12-17
    • 1970-01-01
    相关资源
    最近更新 更多