Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android issue FATAL EXCEPTION: #21

Open
liquidzym opened this issue Mar 23, 2016 · 2 comments
Open

android issue FATAL EXCEPTION: #21

liquidzym opened this issue Mar 23, 2016 · 2 comments

Comments

@liquidzym
Copy link

i'm testing with really simple android app which save the captured image then upload to the server
on each time during the http post session the app got crashed,reported as following:

FATAL EXCEPTION: Animation Thread
java.lang.NoSuchMethodError: org.apache.http.util.EntityUtils.consume
at http.requests.PostRequest.send(Unknown Source)
at processing.test.android_image.android_image.postImg(android_image.java:145)
at processing.test.android_image.android_image.draw(android_image.java:56)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:841)

but without any issue running on desktop. any ideas?

@ptmcg
Copy link

ptmcg commented Apr 1, 2016

I believe I am having this same error. Runs ok from desktop but fails when run from my Android phone. This program illustrates the problem:

import http.requests.*;

public void setup() 
{
  size(800,800);
  background(32);
  smooth();
}

public void draw() {
}

public void mouseReleased() {
  JSONObject rpt = new JSONObject();
  rpt.setLong("ts", System.currentTimeMillis());
  JSONArray latlng = new JSONArray();
  latlng.append(mouseX);
  latlng.append(mouseY);
  rpt.setJSONArray("posn", latlng); 
  PostRequest post = new PostRequest("http://192.168.1.12:11111/echo", "UTF-8");
  post.addHeader("Content-Type", "application/json");
  post.addData("", rpt.format(0));
  post.send();
}

The web page is just a 10-line Python/falcon server that echoes the inbound request body to standard output. (I had to do some hacky stuff to get the JSON from the form-like request body - I can post that elsewhere.)

@mahler52
Copy link

mahler52 commented Dec 3, 2016

I too. I wrote a small sketch . It calls a website using getRequest. Simple. It works well in java mode but fails when downloaded to my 2 android tablet/phones . Same fatal exception of yours. I was considering to use another library but I don t know any other http library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants