Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
396 views
in Technique[技术] by (71.8m points)

android - Crashlytics not uploading mapping file

I'm able to see crashes for a release build in Crashlytics but they are still obfuscated. I'm using:

implementation "com.google.firebase:firebase-core:16.0.5"
implementation "com.google.android.gms:play-services-base:16.0.1"
implementation "com.crashlytics.sdk.android:crashlytics:2.9.6"

and (project level)

    classpath 'com.android.tools.build:gradle:3.2.1'
    classpath 'com.google.gms:google-services:4.2.0'
    classpath 'io.fabric.tools:gradle:1.26.1' // Crashlytics plugin
    classpath "net.ltgt.gradle:gradle-apt-plugin:0.15"

I've followed the instructions at https://firebase.google.com/docs/crashlytics/get-deobfuscated-report, in particular I've deleted the -printmapping <path>/mapping.txt line from config.txt

When I look in the Crashlytics log I do not see an upload of the mapping file.

When I run a release build for an earlier version of my project using:

implementation "com.google.firebase:firebase-core:11.8.0"
implementation "com.google.android.gms:play-services-base:11.8.0"
implementation('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
    transitive = true
}

and (project level)

    classpath 'com.android.tools.build:gradle:3.1.3'
    classpath 'com.google.gms:google-services:3.0.0'
    classpath 'io.fabric.tools:gradle:1.24.4'

then I see unobfuscated stack traces and mapping upload messages in crashlytics.log:

2018-11-21 10:52:22.573 [DEBUG] (Daemon worker) com.crashlytics  - Deobfuscation file(s) uploaded.

Any ideas what's wrong? I don't see any of the mapping file related logs for the recent (not working) version in the Crashlytics log and I don't see the gradle upload task running in the gradle output whereas for the older (working) version I see the following:

:app:crashlyticsUploadDeobsRelease (Thread[Daemon worker Thread 2,5,main]) completed. Took 1.28 secs.
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Argh. Well there was a simple fix, shame it took me so long to find it. I always (until now) build and locally install a release build using ./gradlew iR (shortcut for ./gradlew installRelease). I tried (after an embarrassingly long time) building from Android Studio instead (Build > Generate Signed Bundle / Apk). As soon as I did that it worked.

I'll update here if and when I figure out non-AS based releasing works with Crashlytics. Meanwhile if you're having problems take a look at the sample https://github.com/firebase/quickstart-android/tree/master/crash. You can take that, drop in your own google-services.json and release as above, then check crashlytics.log (see above) .


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...