- Jun 6, 2020
- 11,559
- 4,422
I'm updating some previously working code which uses the OkHttpUtils2 library.
The code needs to be compatible with android api levels 19, 23 and 28.
Since the code was last compiled there has been an update to the native java OkHttp library and android api level 19 is no longer supported.
On an api 19 device I now see the error:
I tried switching from OkHttpUtils2 to the older HttpUtils2 library.
This works on api 19 and api 23 but not on api 28 where I see the error:
I thought I'd detect the device api level at runtime.
If it's...
The code needs to be compatible with android api levels 19, 23 and 28.
Since the code was last compiled there has been an update to the native java OkHttp library and android api level 19 is no longer supported.
On an api 19 device I now see the error:
On an api 23 device the code works fine, and on an api 28 device the code works fine.Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 19
at okhttp3.internal.platform.AndroidPlatform.<clinit>(AndroidPlatform.kt:153
Click to expand...
I tried switching from OkHttpUtils2 to the older HttpUtils2 library.
This works on api 19 and api 23 but not on api 28 where I see the error:
In api 28 (or some earlier version) Google have removed the old Http library.Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.client.methods.HttpGet" on path
Click to expand...
I thought I'd detect the device api level at runtime.
If it's...
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید