vijay053
vijay053

Reputation: 872

Why I am getting obfuscated code in logs even after uploading mapping.txt on Firebase Crash Report?

I am using Firebase crash reporting into my android app. I am using Proguard to obfuscate my app. I have uploaded mapping.txt file generated after building release apk, to the Firebase Crash reporting, but I am still getting some Obfuscated code, mainly code from libraries used into my project as below.

Caused by java.lang.NullPointerException: Attempt to invoke virtual method   
'long com.google.firebase.b.a.a(java.lang.String)' on a null object reference
com.myapp.myodulel.GamePageFragment.onActivityCreated (GamePageFragment.java)
__null__.access$300 (GamePageFragment.java)
android.support.v4.app.Fragment.getActivity (Fragment.java)
__null__.performActivityCreated (Fragment.java)
android.support.v4.app.FragmentManagerImpl.modifiesAlpha     (FragmentManagerImpl.java)

Third party apps functions are not visible properly as "com.google.firebase.b.a.a". Also I am not getting proper line number of errors.

I am using following jars into my project.

compile 'com.google.firebase:firebase-ads:9.8.0'      
compile 'com.google.firebase:firebase-config:9.8.0'
compile 'com.google.firebase:firebase-crash:9.8.0'
compile 'com.google.android.gms:play-services-analytics:9.8.0'
compile 'com.android.support:appcompat-v7:24.1.1'
compile project(path: ':BaseGameUtils')
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.facebook.android:facebook-android-sdk:4.8.2'

I believe I have not configured proguard properly to use these third party apps. I have seen their documentation, but they have not mentioned what to add and how to add. Please help me as I am new to Proguard.

Edit:

Currently my proguard-rule.pro file has following code other than comments.

-dontwarn com.squareup.okhttp.**

I did some research and I think I need to add -keep flag for third party libraries I am using in my app like firebase and google play service. But will it compromise obfuscation? And will I get line numbers of errors after that? Or I have to do something else?

Upvotes: 2

Views: 907

Answers (1)

F43nd1r
F43nd1r

Reputation: 7749

Add

-keepattributes SourceFile,LineNumberTable

to your proguard config to see correct line numbers.

Upvotes: 1

Related Questions