1

I recently moved some code to a library project. Since then, when a crash happens in that library, the stack trace of the crash report doesn't show the line number in the library's code - Unknown Source is shown instead.

The problem is quite obvious - hard to fix an NPE if I don't know in where it happened.

Example:

java.lang.NullPointerException
at library.SomeClass2.b(Unknown Source)
at library.SomeClass1.a(Unknown Source)
at android.app.SomeClass.a(SomeClass.java:239)
...

* Note that the library project is a regular Java project - referenced from the Android project (No hanky-panky - simple eclipse java project dependency).

AlikElzin-kilaka
  • 34,335
  • 35
  • 194
  • 277
  • 1
    are you using proguard? – greywolf82 May 25 '14 at 15:39
  • @user2944616 - I see a proguard.cfg file in the Android project. It was generated long time ago when I first created the project. Why do you ask? – AlikElzin-kilaka May 25 '14 at 15:49
  • I saw that sometimes tha infromation was not complete when I used proguard. – greywolf82 May 25 '14 at 15:54
  • @user2944616 - I guess there was a reason for the proguard file to be generated. Anyhow, I couldn't find anything on the web regarding missing line numbers info on Android crash reports - nor any connection to the proguard file. – AlikElzin-kilaka May 25 '14 at 15:58
  • I removed the proguard file (proguard.cfg) completely. The apk is 6.6MB instead of 6.4MB. Small difference IMO. I'll update on the results. – AlikElzin-kilaka May 27 '14 at 10:07
  • I deleted the proguard file completely and still see no line numbers - shows `..(Unknown Source)`. I tested it by publishing an alpha version that throws exception in a library file. – AlikElzin-kilaka May 28 '14 at 08:38
  • You might be able to edit your proguard settings to get it to keep line numbers. Similar question here: http://stackoverflow.com/questions/17861986/how-do-you-interpret-a-deobfuscated-android-crash-report – ktusznio Jul 22 '14 at 17:43
  • @ktusznio - the line numbers are shown for my android project classes but not for the java library classes. Proguard seems to be configured ok. – AlikElzin-kilaka Jul 23 '14 at 04:48
  • Check the compiler settings for your library project, it should be configured to generate debug information for the compiled class files. – iddo Jul 28 '14 at 18:57
  • @iddo - what "compiler settings"? – AlikElzin-kilaka Jul 29 '14 at 03:49
  • These ones: http://stackoverflow.com/questions/6634525/eclipse-compiler-options-how-can-i-set-the-debug-level – iddo Jul 29 '14 at 06:21
  • @iddo - all checkboxes checked. Eventually it's built by Android's build mechanism - ant. The build looks at the .classpath but don't know if it looks at all the params of the Eclipse project. – AlikElzin-kilaka Jul 29 '14 at 10:08

0 Answers0