首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Bugsnag:上传源映射错误?

Bugsnag:上传源映射错误?
EN

Stack Overflow用户
提问于 2018-06-08 11:17:30
回答 1查看 647关注 0票数 1

我试图将源代码映射上传到Bugsnag,以便在发生错误时查看完整的堆栈跟踪,而不是绑定文件的堆栈跟踪。我遵循了页面上的说明,但在构建APK时遇到了这个错误:

代码语言:javascript
复制
> Task :app:uploadBugsnagReleaseMapping
Mapping file not found: null

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

代码语言:javascript
复制
Mapping file not found: C:\Development\React Native Practise\bugsnag_practise\android\app\build\outputs\mapping\release\mapping.txt

我认为我需要手动添加该文件,因此我在该目录中添加了一个带有该名称的空文本文件,并得到如下结果:

代码语言:javascript
复制
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中的错误配置

代码语言:javascript
复制
bugsnag {
    autoUpload true
    ndk false
    autoReportBuilds true
    autoProguardConfig true
    overwrite true
    retryCount 5
}

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

代码语言:javascript
复制
buildTypes {
    release {
        signingConfig signingConfigs.release
        minifyEnabled enableProguardInReleaseBuilds
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    }
}

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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-06-22 17:59:25

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

代码语言:javascript
复制
# 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

再试一次

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50759480

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档