Google Play Dev Console showing Class and Method names in Stacktrace
Asked Answered
P

2

8

I have an app with Proguard enabled (minifyenabled true) and recently got a crash report in the Google Play Dev Console. When I looked at it, I saw the following:

enter image description here

I was surprised to see the full class and method names in line 1, as Proguard is enabled. I've always previously seen things like this:

at com.myname.myapp.c.f (Unknown Source)

I'm also curious how the line number is appearing as I'm not preserving line numbers in my Proguard config file (hence, why I usually see 'Unknown Source' in my stacktraces).

I decompiled my .apk, peeked at the classes.dex file and it all looked OK. I located the class referenced in line 1 of the stacktrace and the class name was indeed obfuscated, as was the method name.

Now, 'MyActivity' (line 2 of the stacktrace) is the launch Activity of my app, and as such is declared in the Manifest, so I understand why it's name is not obfuscated, and the 'onConnected' method is not a method of mine (it comes from Google Play Games Services), so, again, this is OK.

'MyMethodName' is called from within onConnected like so:

@Override
public void onConnected(Bundle arg0) {
    myClassObject.myMethodName();       //Where myClassObject is an instance of MyClassName
}

Debug is set to disabled in my build.gradle file.

I don't upload mapping.txt files to the Play Console, I run retrace manually to see my de-obfuscated stacktraces.

I'd appreciate if someone could help me understand why I'm seeing my full class and method name here? What can/should I do to prevent this?

Pinhole answered 3/9, 2017 at 13:31 Comment(1)
Is MyClassName is an Activity class? Are you using default ProGuard rules?Dufour
P
3

After weeks of agonising over this, I finally discovered the cause...

Suffice is to say, my released app is completely obfuscated - these de-obfuscated stack traces are coming from my own test device!!

Yes, my own test device running the app directly via Android Studio and unsigned. (And for obvious reason, I don't enable ProGuard on my debug builds).

The device I used for testing this app isn't a 'mainstream' device and the 'name' that appears in the Dev Consol bears no resemblance to the actual name of the device so I didn't notice straight away.

I'm fairly sure this never happened in the past (I've certainly not see it until now) - quite why anyone would want crash reports from their debug builds to appear in the Dev Console along with production build crashes, I don't know.

So, if someone is seeing this problem, check it's not your own debug builds causing the influx of stack traces before anything else!

Pinhole answered 12/9, 2017 at 15:23 Comment(0)
B
-2

I don't upload mapping.txt files to the Play Console, I run retrace manually to see my de-obfuscated stacktraces.

Then you may want to add the mapping.txt to google play which will ensure that your packages and classes names are obfuscated.

Borderer answered 11/9, 2017 at 12:10 Comment(1)
This isn't correct - mappings.txt is uploaded so that you can view de-obfuscated stack traces within the developer console directly without having to manually use a tool like retrace. It has nothing to do with keeping them obfuscated. Quite the opposite. See: support.google.com/googleplay/android-developer/answer/…Pinhole

© 2022 - 2025 — McMap. All rights reserved.