我试图将源代码映射上传到Bugsnag,以便在发生错误时查看完整的堆栈跟踪,而不是绑定文件的堆栈跟踪。我遵循了这页面上的说明,但在构建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"
}
}是否缺少将填充此文件的配置选项?
发布于 2018-06-22 17:59:25
您需要在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再试一次
https://stackoverflow.com/questions/50759480
复制相似问题