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

Android Support Below API 26 (Oreo) #264

Closed
JeffPereyma opened this issue Apr 5, 2022 · 6 comments · Fixed by #323 or #326
Closed

Android Support Below API 26 (Oreo) #264

JeffPereyma opened this issue Apr 5, 2022 · 6 comments · Fixed by #323 or #326
Assignees

Comments

@JeffPereyma
Copy link

Hello,

I am using the jCasbin library on Android, and it looks like one of the dependencies of the project AviatorScript is using a Java 8 Language method only supported in Android 26 and above. This makes the jCasbin library unusable for a large portion of devices (~20%).

The Java method in question is invokeExact(Object... args) and invoke(Object... args)

And while Android does support backwards compatibility for most Java 8 language features, you will notice in this documentation that it does not include the two methods mentioned above.

Thanks!

@casbin-bot
Copy link
Member

@tangyang9464
Copy link
Member

@JeffPereyma Do you have any good suggestions to solve the issue? Android official advice can't solve this issue.

@hsluoyz
Copy link
Member

hsluoyz commented Apr 6, 2022

@JeffPereyma what Java SDK version do you need?

@JeffPereyma
Copy link
Author

@hsluoyz @tangyang9464 Java 7 and 8 features should all be fine, but it is specifically the MethodHandle class that is not available. My understanding is Android ports over their own version of Java as part of it's Android SDK. It would seem these ports for earlier versions of Android do not include the MethodHandle class.

Since then it seems they have been able to do things like desguaring to allow access to the newer features on older versions, but it specifically excludes the MethodHandle class as I referenced above.

I'm not sure on the fix (outside of removing the problem method from the dependency). But as to what to replace it with I am not sure as this is quite outside of my wheelhouse, but I will see if I can stumble through enough to give some better ideas.

I did find a similar issue on another android library that ran into the same issue (Library: Mockito, offending dependency: Objenesis). It looks like maybe they were able to solve the issue but I'm not totally sure I can confidently follow it.

This is the issue that was opened on the offending project:
easymock/objenesis#79

I'll continue to dig around but hopefully that at least gives some hints towards a solution?

@hsluoyz
Copy link
Member

hsluoyz commented Apr 7, 2022

@JeffPereyma can you create an issue at: https://github.com/killme2008/aviatorscript ?

@PrathamJaiswal001

This comment was marked as abuse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment