Note that there are some explanatory texts on larger screens.

plurals
  1. PODalvik cannot find class inside external JAR through reflection
    primarykey
    data
    text
    <p>I've been doing some reflection code for quite a while now, but only came to an issue lately because of the external JARs. The JARs in question here are those associated with HTTPPost <a href="http://developer.android.com/reference/org/apache/http/client/methods/HttpPost.html" rel="nofollow">http://developer.android.com/reference/org/apache/http/client/methods/HttpPost.html</a> so that I can do a POST request</p> <p>I use the same IDE Eclipse to code my Java code and the Android code in seperate projects. </p> <p>In my Android project I have copied the JAR files into the /libs folder, and the JARs are added to Android Dependencies.</p> <p>In the Java project I've added the dependencies within the IDE so that I do not get the coding errors popping up.</p> <p>To 'compile' the Java project I use the following command lines</p> <pre><code>javac -classpath android.jar;httpclient-4.1.2.jar;httpcore-4.1.2.jar;httpmime-4.1.2.jar MyReflectionClass.java jar -cf MyReflectionClass.jar MyReflectionClass.java dx --dex --output=classes.dex myreflectionclass.jar </code></pre> <p>No errors reported.</p> <p>These steps have always worked fine when I did not require external JARs, until now. It seems like the first line isn't enough to 'import' the JARs/annotations (I don't know these terms really well)</p> <p>The Android project is able to load the class within the Java project, and the Java code executes until this line</p> <pre><code>MultipartEntity ent = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); </code></pre> <p>where I get this error in Logcat</p> <pre><code>tag = dalvikvm text = Could not find class 'org.apache.http.entity.mime.MultipartEntity', referenced from method MyReflectionClass.mymethod </code></pre> <p>Please help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload