Android Question "Please fix." Fix what?

drgottjr

Expert
Licensed User
Longtime User
this simple test works as expected on my normal devices (pixel3A, android 12, motorola 5 something, etc).
B4X:
Sub Globals
    'These global dimiables will be redeclared each time the activity is created.
    Dim ph As Phone
End Sub

Sub Activity_Create(FirstTime As Boolean)
    
Log(ph.SdkVersion)
Dim url As String = "https://www.google.com"
Dim j As HttpJob
 
j.Initialize("", Me)
j.Download(url)

Wait For (j) Jobdone(j As HttpJob)
If j.Success Then
    Log(j.GetString)
Else
    Log(j.ErrorMessage)       
End If
j.Release   
    
End Sub

however, when i deploy it to a tablet obtained from a faraway asian land and allegedly running android 9
fix4.jpg

i get this:
B4X:
B4A Version: 11.20
Parsing code.    (0.01s)
    Java Version: 11
Building folders structure.    (0.06s)
Compiling code.    (0.02s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (0.65s)
Linking resources    (0.66s)
Compiling generated Java code.    (0.29s)
Convert byte code - optimized dex.    (5.14s)
Copying libraries resources    (0.46s)
ZipAlign file.    (0.02s)
Signing package file (private key).    (0.75s)
Installing file to device.    Error
Performing Push Install
oktest.apk: 1 file pushed, 0 skipped. 6.0 MB/s (1500497 bytes in 0.239s)
WARNING: linker: libvc1dec_sa.ca7.so has text relocations. This is wasting memory and is a security risk. Please fix.
WARNING: linker: libvc1dec_sa.ca7.so has text relocations. This is wasting memory and is a security risk. Please fix.
    pkg: /data/local/tmp/oktest.apk
Failure [INSTALL_FAILED_OLDER_SDK]

with the instruction to "Please fix". what does it want me to fix?
 

Attachments

  • fix.png
    fix.png
    45.5 KB · Views: 232
  • fix3.PNG
    fix3.PNG
    19.9 KB · Views: 217

emexes

Expert
Licensed User
this simple test works as expected on my normal devices (pixel3A, android 12, motorola 5 something, etc).

= it works with Android version 12 (released 3.5 months ago) but not with Android version 9.0 ?

Does an even simpler test (eg Hello, World!) work?
 
Last edited:
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
it says 9; that doesn't mean it's 9.

because the screen is so large, i've been using it to deploy things built with b4a 11.20, java11, and sdk30 for the last few days to save my fading eyesight. some fairly involved stuff, without any issues. but here's a hello,world for you.

i just noticed google points me back to the forum. this error was reported, like, 7 yrs ago here
erel suggested then it was a bug in the installer... i guess it's still buggy. anyway, thanks for the interest.
 

Attachments

  • hello.png
    hello.png
    11.4 KB · Views: 214
  • hello2.png
    hello2.png
    24.8 KB · Views: 205
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
seems to be part of it. when i ratchet the minsdk to 19 in the manifest, another veil is removed:

log output:
** Activity (main) Create, isFirst = true **
19
** Activity (main) Resume **
*** Service (httputils2service) Create ***
httputils2service_service_create (java line: 255)
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 b4a.example.httputils2service._service_create(httputils2service.java:255)
    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 b4a.example.httputils2service.onCreate(httputils2service.java:56)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2731)
    at android.app.ActivityThread.access$1800(ActivityThread.java:151)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1403)
    at android.os.Handler.dispatchMessage(Handler.java:110)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:5292)
    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:824)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
    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
httputils2service_service_create (java line: 255)
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 b4a.example.httputils2service._service_create(httputils2service.java:255)
    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 b4a.example.httputils2service.onCreate(httputils2service.java:56)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2731)
    at android.app.ActivityThread.access$1800(ActivityThread.java:151)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1403)
    at android.os.Handler.dispatchMessage(Handler.java:110)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:5292)
    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:824)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
    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

the "19" at the start is the tablet's sdk. located at a couple spots in the log output is:
Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 19
at okhttp3.internal.platform.AndroidPlatform.<clinit>(AndroidPlatform.kt:153)

so it looks like okhttp (or maybe okio) needs minsdk21 to run. device is 19. i've run a lot of different things on the device, but i'm guessing this was the first time for okhttputils2 (at least since updating to b4a 11.20 (+ a special, separate update to okio, per a recent post by erel).
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
right. because okhttputils2 depends on okhttp.jar and okio-2.8.0.jar, one or both of which require 21.
if i understand the original error, this is something not picked up by the compiler, but by the linker later on. i'm accustomed to seeing compiler errors. a linker error surprised me, and i failed to consider that some external element had its own requirements as to minsdk. always interesting.
 
Upvote 0
Top