Ant task is unable to recognize android private libraries

123 views Asked by At

I am trying to run findbugs through ant. This is a snippet of a part of my build file:

<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" >
<classpath>
<fileset dir="${findbugs.home}/lib" includes="**/*.jar"/>
 <pathelement location="${project.target.android.jar}" />
</classpath>
</taskdef>

 <path id="build.classpath">
     <pathelement location="${project.target.android.jar}" />
         <fileset dir="libs">
          <include name="*.jar"/>
         </fileset>
 </path>

<target name="findbugs" >
<findbugs home="${findbugs.home}" output="html" outputFile="findbugs/findbugs.html">
<class location="${out.classes.absolute.dir}" />
<auxClasspath refId="build.classpath"/>
<sourcePath path="${source.absolute.dir}" />
</findbugs>
</target>

This is unable to recognize the android library and gives errors like: cannot find android.os.Bundle, etc,...

How do I make it recognize android libraries? I have tried including it using , but this doesn't seem to work. I am not aware of the complete build file, but the main project compilation works fine, and the android lib included there are in this format:

<gettarget
                androidJarFileOut="project.target.android.jar"
...
1

There are 1 answers

0
MeBigFatGuy On

Findbugs works on Java's class file format. Android uses another format called dex. So Findbugs will not work on that.