-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify minimum Android API level (+ add Animal Sniffer to verify this) #2429
Comments
In 2018 usage of Android devices with API level < 19 was apparently already only at ~5% (in later years this statistic was not published on that webpage anymore). Now at the time of writing the API Version Distribution shown in Android Studio says API level < 21 is ~0,5%. So maybe choosing either 19 or 21 as minimum API level might be reasonable (though note that I am not very familiar with Android development, so maybe my judgement is wrong here). |
Regarding those |
Thanks for doing all that detailed research! According to The Animal Sniffer serialization thing is a bit unsettling. It's probably OK, but if we really wanted to be careful I suppose we could have the check be a separate CI step that does nothing else. So in particular it couldn't modify the compiled binaries, which I would see as the main risk if the signature files were compromised. |
I have done a bit more testing; using the API level 18 signatures showed these unsupported usages:
Not sure if for some of them there is desugaring support. But I think either way supporting API level < 19 might be rather inconvenient. For the API level 19 signatures no unsupported usage was found, so I assume we could also use that as minimum version at first, but at least personally I don't mind if we directly chose 21 as minimum API level instead (even if we might actually support API level 19).
That sounds like a good solution for now. |
Problem solved by the feature
The README only specifies that Java 7 is the minimum version for the latest Gson versions. However, for Android developers this information is not that helpful because Java 7 API was added in multiple different Android API levels. For example
java.lang.ReflectiveOperationException
added in Java 7 was only added for Android API level 19 (Android 4.4), see also #2310 (comment).Feature description
This can be verified using Animal Sniffer, see:
(to be verified that these artifacts are safe; but appears they are also used by other projects, e.g. OkHttp (code))
In that case would have to explicitly mention desugaring (using the latest Android build tools?) in the README
Alternatives / workarounds
none
The text was updated successfully, but these errors were encountered: