Android Question org.apache.http.ParseException not found

aedwall

Active Member
Licensed User
Longtime User
My project works with v7.30, but does not work with v7.80:

Compiling generated Java code. Error
B4A line: 55
Log(Response.GetString(\
javac 1.8.0_66
src\anywheresoftware\b4a\helen\httputils2service.java:158: error: cannot access ParseException
anywheresoftware.b4a.keywords.Common.Log(_response.GetString("UTF8"));
^
class file for org.apache.http.ParseException not found
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

aedwall

Active Member
Licensed User
Longtime User
It has nothing to do with the b4a 7.3 or 7.8. The Device you are using is running Android 5+ i guess. You need to switch to okhttp!

Switch from httputils2 to okhttp and okhttputils2
https://www.b4x.com/android/forum/threads/okhttp-replaces-the-http-library.54723/#content

Thank you. I have to say I am confused by all these different platform numbers, 17, 19, 23, 27, etc. I have no idea what to specify or what is required. I think that I should specify platform 17 if I want folks with Jellybean to be able to use my code. If I specify 27, then only those folks with Oreo or whatever the last version of Android was can use it. Am I right in this assumption?
 
Upvote 0

aedwall

Active Member
Licensed User
Longtime User
It has nothing to do with the b4a 7.3 or 7.8. The Device you are using is running Android 5+ i guess. You need to switch to okhttp!

Switch from httputils2 to okhttp and okhttputils2
https://www.b4x.com/android/forum/threads/okhttp-replaces-the-http-library.54723/#content

I have tried to do this and I get the attached error message:

I don't know where to look in order to find the second declaration.

UPDATE: I downloaded the file named "HttpUtils2_Src.zip" and put those 2 .bas files into my project, replacing what I had. I might have done something else - I don't remember. But it is now working. Oh, I think I removed the "OkHttpUtils2" library from the project. I'm not sure what I am doing, but it now runs on the emulator.
 

Attachments

  • Screenshot_2.png
    Screenshot_2.png
    2 KB · Views: 261
  • Screenshot_3.png
    Screenshot_3.png
    7.1 KB · Views: 283
  • Screenshot_4.png
    Screenshot_4.png
    3.4 KB · Views: 274
  • Screenshot_5 - new library setup.png
    Screenshot_5 - new library setup.png
    6.4 KB · Views: 251
Last edited:
Upvote 0

aedwall

Active Member
Licensed User
Longtime User
Because I could not get it to work any other way. It works now, so that's kind of all I care about. I don't remember how I did everything back when I originally made this project - it was long ago. But it worked back then with an old version of b4A and it works now with v7.80 (if I use the old version of my Swiss Ephemeris library).

UPDATE: I did what you suggested and everything appears to still be working. Thank you.
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
Another hint: Me and a lot of users here use OkHttputils in many projects exchanging millions data via servers with databases. I never had any issues with B4x. Be sure that B4x is absolutely stable. IF there is a problem it is 100% due to programming mistakes/not updatung, etc.
 
Upvote 0
Top