Skip to content

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

Closed
@JordanLongstaff

Description

@JordanLongstaff

Guava Version

33.4.7-jre

Description

The latest version of Guava uses MethodHandle which is only available in Android API 26 or later. My app supports API 21 at the minimum, and it uses the latest release of Guava to patch a security vulnerability, only now it won't build because Guava uses methods that are not supported in the minimum SDK version. And I have no desire to increase it in my app.

Example

Any Android app with minimum SDK version lower than 26, using the latest version of Guava, would suffice. Here's a PR build from my repo that failed:
https://github.com/JordanLongstaff/ArtemisAgent/actions/runs/14347309233/job/40219434611?pr=189

Expected Behavior

App should still build as normal.

Actual Behavior

App cannot build because of MethodHandle. See the link in the example for more info.

Packages

No response

Platforms

Android

Checklist

  • I agree to follow the code of conduct.

  • I can reproduce the bug with the latest version of Guava available.

Metadata

Metadata

Assignees

Labels

P1type=defectBug, not working as expected

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions