PreEmptive logo

Protecting Android Applications That Use Crashlytics

support-6

With our recent DashO releases, we’ve been working to make our Android support even easier to use. A great example is our evolved support for Crashlytics, an analytics framework that can provide detailed reports on application crashes from the field. 

When applications are obfuscated, the stack traces will contain obfuscated class and method names. To prevent this from complicating debugging, Crashlytics provides a utility to automatically deobfuscate stack traces so that the reporting server shows the original class and method names. It does so by reading the map file, which is a file created by the obfuscation tool to pair the obfuscated class and method names with the original names. Crashlytics expects this map file to be in a ProGuard-compatible format, which differs from the DashO map file format.

If you were using Crashlytics with a version of DashO before our 8.5, this would likely have caused issues. You might have experienced an error during the Gradle build, from the Crashlytics plugin: A problem occurred configuring project ':app'. > path may not be null or empty string. path='null' 

You could add custom scripting to your build to resolve this build error.gradle file to call DashO’s ConvertMap utility, which could convert the DashO map file into ProGuard format.

After adding the custom scripting, your Gradle build will complete. However, when you viewed your Crashtlyics portal, you still might see obfuscated stack traces: 
… Caused by java.lang.ArithmeticException: Could not complete product registration 
at classes.foobaz.f(Unknown Source)
at classes.foobaz.k(Unknown Source)
at classes.foobaz.q(Unknown Source)
at classes.foobar.a(Unknown Source)
at classes.foobar.w(Unknown Source)
at com.example.the.crashlyticsexample.MainActivity.forceCrash(Unknown Source)
at java.lang.reflect.Method.invoke(Method.java)
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:384)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95) 

Additional settings were required in your dasho. gradle file to ensure that the stack traces appeared in an unobfuscated format. 

With our 8.5 version, after initially running your Android project through the Wizard, DashO will automatically manage the translation of the map file from DashO map format to ProGuard format and put it where Crashlytics expects to find it. Thus, it will be uploaded to the Crashlytics server without any additional configuration.

While DashO continues to support a full range of Java applications, we’ve been paying special attention to our support of Android applications. This is one of several reasons you should always stay current with your DashO version. 

For more details about this topic, please refer to our Gradle documentation. You can also contact us by submitting a request here: Preemptive Support Center.

In This Article:

Try a Free Trial of PreEmptive Today!