Android Question Compile App targeted to old devices

incendio

Well-Known Member
Licensed User
Longtime User
Hi guys,

I have users who still use Android 4. With new B4A, when compile, I got an error in OkHttpUtils2 Library ver 3.

Is there a solution for this problem?

In manifest editor, minSdkVersion="5" android:targetSdkVersion="26"
 

incendio

Well-Known Member
Licensed User
Longtime User
Here are the error message :


Logger connected to: 192.168.99.106:5555
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
*** Service (starter) Create ***
Using FileProvider? false
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
*** Service (httputils2service) Create ***
httputils2service_service_create (java line: 263)
java.lang.ExceptionInInitializerError
at okhttp3.internal.platform.Platform$Companion.findAndroidPlatform(Platform.kt:219)
at okhttp3.internal.platform.Platform$Companion.findPlatform(Platform.kt:212)
at okhttp3.internal.platform.Platform$Companion.access$findPlatform(Platform.kt:169)
at okhttp3.internal.platform.Platform.<clinit>(Platform.kt:170)
at okhttp3.OkHttpClient.<init>(OkHttpClient.kt:237)
at okhttp3.OkHttpClient$Builder.build(OkHttpClient.kt:1069)
at anywheresoftware.b4h.okhttp.OkHttpClientWrapper.Initialize(OkHttpClientWrapper.java:94)
at com.MyApp.httputils2service._service_create(httputils2service.java:263)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at com.MyApp.httputils2service.onCreate(httputils2service.java:56)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2558)
at android.app.ActivityThread.access$1800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 19
at okhttp3.internal.platform.AndroidPlatform.<clinit>(AndroidPlatform.kt:153)
... 24 more


On newer Android, like Android 9, no errors.
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
You should downgrade to the version of b4a before this version.
I have downgraded B4A to version 11.5 where it worked before, but seem the library already affected.
In version 11.5, OkHttpUtils2 already version 3 although I have uninstalled ver 11.8.
 
Upvote 0

jahswant

Well-Known Member
Licensed User
Longtime User
I have downgraded B4A to version 11.5 where it worked before, but seem the library already affected.
In version 11.5, OkHttpUtils2 already version 3 although I have uninstalled ver 11.8.
Go to C:\Program Files (x86)\Anywhere Software\Basic4android and open B4A.exe if yo didn't delete the files else re-install ?
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
Go to C:\Program Files (x86)\Anywhere Software\Basic4android and open B4A.exe if yo didn't delete the files else re-install ?
Yes, that was exactly I did.

I have 2 version B4A installed on same computer, ver 11.5 and 11.8.
Run ver 11.5 from C:\Program Files (x86)\Anywhere Software\Basic4android, but the library already ver 3.0.

Seem that can't run both version on the same computer.

I think if uninstall both version then reinstall ver 11.5 could solve the problem, but will loose new features from latest B4A version.
 
Upvote 0

JakeBullet70

Well-Known Member
Licensed User
Longtime User
See this thread:

You can copy some older libs for the HTTP stuff and still use the new version of B4X
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
See this thread:

You can copy some older libs for the HTTP stuff and still use the new version of B4X
Still got an error. Switching to that thread for more question.
 
Upvote 0
Top