1

I have an android app that uses jsoup that runs fine on a motorola atrix phone running Android 2.3.6 and also works fine on a Samsung Galaxy Tab running 2.3.5.

However, I have tried to run it on my new phone: Samsung Galaxy S4 runnning Android 4.2.2. It can't run jsoup at all.

It chokes on this line of code:

Document document = Jsoup.connect(SPOT_SERVER_BASE).get();

Has anyone else encountered this problem for Android 4.2? (Or 4.1 or 4.0?) Is there something I need to do differently to get it to work?

Thanks for your help.

Jungle Jim
  • 333
  • 1
  • 7
  • 16
  • What's the value of SPOT_SERVER_BASE and what exception it throws? – WindRider May 08 '13 at 21:34
  • SPOT_SERVE_BASE is a string that is the url of the website I am pulling data from. I think its IOException something like "Bad filename or directory" but it makes no sense because it works in Android 2.3 – Jungle Jim May 09 '13 at 02:13
  • I cannot help you a lot if I don't know the exact exception. You could add jsoup sources jar to the libsrc folder and trace the reason for exception. – WindRider May 09 '13 at 19:19
  • Here's what it wrote to the console: "An established connection was aborted by the software in your host machine java.io.IOException: An established connection was aborted by the software in your host machine" – Jungle Jim May 09 '13 at 20:59
  • Did you try `Clean` before building? – devnull May 10 '13 at 15:43
  • http://stackoverflow.com/questions/5618664/an-established-connection-was-aborted-by-the-software-in-your-host-machine – WindRider May 10 '13 at 21:45

1 Answers1

0

I haven't figured out what causes the problem, but I have figured out how to fix it.

In the manifest, I deleted this line: android:targetsdkversion="xx"

where "xx" is whatever version you are using for the target in your build.

The only place where I indicate the project build targtet is where you edit the project properties by right-clicking on the package name and selecting "properties".

Why does this work? I have no idea.

Jungle Jim
  • 333
  • 1
  • 7
  • 16