EsotericSoftware/kryo

New objenesis version excludes 60% of android devices

Erhannis opened this issue · 6 comments

The version increase of objenesis to 3.0.1, in kryo 5.0.0-RC3, yields the following error in my Android project:

MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)

By the numbers at https://developer.android.com/about/dashboards, only ~40% of devices are at API 26 and above, as of May 2019. (Some of the devices, like mine, have no system updates available, and likely never will.) Requiring your users to drop 60% of THEIR users seems like a good way to lock people into an old version of your library (and also I'd prefer I didn't get locked into an old version of your library on my own projects).

Sorry for the late response!

I didn't realize this was the case. Maybe you could provide a PR to go back to the latest reasonable version of objenesis?

@Erhannis: You always override the dependency version of Objenesis back to version 2.6 in your project. Kryo is still fully compatible with 2.6.

There is a relatively new open issue in objenesis (easymock/objenesis#79). Apparently they are planning for a fix soon

There is a detailed discussion of these issues over at Mockito: mockito/mockito#2007

JBou commented

The upstream issue has been closed. It has been fixed in objenesis 3.2
easymock/objenesis#79

Can someone verify that this really resolves the problem? If so, I'll bump the dependency.