-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Jetty-Server and Jetty-Servlet libraries with version 9.4.36. v20210114 and above do not compile in Android < 26 #6128
Comments
Jetty 9.4.x is in maintenance mode for open source at the moment. You will have to exclude the specific classes that use MethodHandle in your project's usage of Jetty. Also, would recommend using jetty 9.4.39.v20210325 - https://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.39.v20210325 |
Hi, I'm having a similar issue. I'm currently implementing a chatbot using cometd, so in my Android project I have the following dependency:
Whenever I try to build the project I get the following error:
So the error is triggered in My current min SDK version is 22 so change it to 26 is not an option... what can I do? |
@joakime According to your link and if I understand correctly the issue should have been fixed on For me it still doesn't work |
I just tried with
|
Jetty 11.x is for Java 11+ with the new Stay in Jetty 9.4.x series for Android. |
This issue has been automatically marked as stale because it has been a |
Hello
In its turn, CometD 6.0.10 (Jetty 10.0.14) fails with this Desperately need help, I'm stuck at CometD 3.1.14, which is 3 years old already and has been deprecated. |
@amatsehor-atd I opened a new Issue #9676 for you, please use that. |
9.4.36.v20210114 and above
Java 8
Android < 7.0
Android SDK < 26
Description
Jetty library modules like jetty-server and jetty-servlets which uses MethodHandle class are not compiled in Android version < 7.0. MethodHandle class is only available in Android SDK 26 and above. Even Desugaring Java 8 APIs not supported for MethodHandle#invoke and MethodHandle#invokeExact methods.
Java 8 API support
This forces android application developers either to drop the support for Android devices with OS version < 7.0 or opt for deprecated version of Jetty libraries.
Note
Please note issue is reproducible with release build only with following lines added in progaurd-rules.pro file and minifyEnable=true in app:build.gradle file.
Error
/Users//.gradle/caches/transforms-2/files-2.1/0b4b98c454d0056234e2aa9cd16ad6f4/jetified-jetty-server-9.4.39.v20210325.jar: R8: com.android.tools.r8.a: MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)
FAILURE: Build failed with an exception.
Execution failed for task ':app:minifyReleaseWithR8'.
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
The text was updated successfully, but these errors were encountered: