Skip to content
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

Unable to build (on Android projects with minSdk lower than 26 I guess) #38

Open
DatL4g opened this issue Sep 19, 2024 · 5 comments
Open

Comments

@DatL4g
Copy link

DatL4g commented Sep 19, 2024

When applying the plugin (2.4.5), I can't build my app with the following error:

MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26): Ldev/datlag/mimasu/tmdb/api/_CreditsImpl;details(Ldev/reformator/stacktracedecoroutinator/provider/DecoroutinatorSpec;Ljava/lang/Object;)Ljava/lang/Object;

This does not only happen to my "personal" code, but to libraries like lifecycle as well.

@Anamorphosee
Copy link
Owner

Hi, @DatL4g
Unfortunately, Decoroutinator works only on Android SDK level 26 or higher. Because it requires MethodHandle API which is available only from this version.

@DatL4g
Copy link
Author

DatL4g commented Sep 19, 2024

Is it possible to only apply this to Android 26+ and keep the "normal" exception on lower versions.
Or is it possible to use Java reflection with invoke() instead?

@Anamorphosee
Copy link
Owner

Anamorphosee commented Sep 19, 2024

Is it possible to only apply this to Android 26+ and keep the "normal" exception on lower versions.

right now there is no such option, but I'll think and maybe can do it in the future.

Or is it possible to use Java reflection with invoke() instead?

Also right now it's not possible. And this option is not a priority because Java reflection makes additional frames unlike MethodHandles

Upd:
although using Java reflection for old Android versions is a good idea. And I'll consider implementing it in the next release.

@nordfalk
Copy link

I would also be very happy if this library didnt force me to upgrade from API 23 to API26.

There are not many users.... but Im reluctant to exclude them "just" to get better stack traces.

So, it would be great if SD allowed lower Android versions, but just didnt do anything at all on these lower SDK versions.

I have no need of getting better stack traces for these old versions, so dont bother adding new complexity, such as fallback on reflection. Just let us compile and and we are happy :-)

@nordfalk
Copy link

The old Android phones are already slow.
I would prefer to not have anything, such as reflection, that makes my app slower on older phones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants