1

Alright, so I have ACRA set up in my application in order to help me gather more information about random crashes that my application might suffer.

java.lang.NullPointerException at com.package.SocketHandler.run(Unknown Source)

And I've came across this one in one of the stacktrace, usually the line number would be written in between the parenthesis, but in this case, I get nothing. Which isn't all that helpful really, especially considering the nature of the exception.

The SocketHandler class is part of a library (jar file) that I link to my Android project (that jar file is also setup to be exported with the project). It's also worth noting the source for the classes contained in this jar file is packaged in it using ANT like so :

<target name="jar">
    <jar destfile="${WORKSPACE_EXPORT}/mylib.jar">
        <fileset dir="${dir.bin.android}" />
        <fileset dir="${dir.src.android}" />
    </jar>
</target>

So my question is: "Am I missing something in order to obtain the line numbers in my ACRA report for the errors that may occur in this external library, given that the source is already bundled with it ?".

Thanks!

UPDATE: I got it working following zapl's lead. I modified my ant build file to enable debugging information in my library like so :

    <javac 
        debug="true"                   <!-- added this line -->
        debuglevel="lines,vars,source" <!-- and this line -->
        srcdir="${dir.src.android}" 
        destdir="${dir.bin.android}" 
        verbose="false" 
        classpathref="path.class" 
        includeantruntime="false" />
Jean-Philippe Roy
  • 4,752
  • 3
  • 27
  • 41
  • might be in / related to native code which does not support line numbers. Is there more stacktrace for that error than just that one line? If you can reproduce that error on the device does it print more info in logcat? – zapl Apr 17 '12 at 19:37
  • For this specific error, there is just this one line, which I also found pretty odd. Other errors gave me long/full stacktrace with line number. – Jean-Philippe Roy Apr 17 '12 at 19:40
  • that http://stackoverflow.com/questions/1872491/why-are-some-java-libraries-compiled-without-debugging-information might be related then. – zapl Apr 17 '12 at 19:43
  • possible duplicate of [Why some stacktrace do not have line number in java](http://stackoverflow.com/questions/25174761/why-some-stacktrace-do-not-have-line-number-in-java) – Raedwald Aug 07 '14 at 07:06

0 Answers0