-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
protobuf-java 3.10.0 is not compatible with older Android versions #6718
Comments
Thanks for reporting the issue and sorry for the trouble. We added those methods for performance reasons, but if it breaks Java 7 compatibility then we are willing to revert the changes. This might take a few days/weeks. Meanwhile, can you please use 3.9.2? |
Does anyone here understand why this would break Java 7 compatibility when MethodHandle should be available in Java7? https://docs.oracle.com/javase/7/docs/api/java/lang/invoke/MethodHandle.html |
@gmarcosb I think you are right, the issue is not Java 7 specific but rather Android specific. Looking at the Android docs, MethodHandle was added only starting from Android API level 26 (Android O): https://developer.android.com/reference/java/lang/invoke/MethodHandle |
|
We are having this issue too. As like many others, we cannot set |
This should be fixed by #6752. Based on the timeline I'll see if it makes sense to do a |
This is now fixed at master, we will include it in the 3.11 release. |
@rafi-kamal do you know the timeline of the 3.11 release? I don't see a milestone for it in the issue tracker. |
That release broke compatibility with Android, 3.9.2 is safe and a fix is due in 3.11: protocolbuffers/protobuf#6718 (comment)
3.11 will be released sometime next week. |
I've uploaded 3.11.0-rc1 to Maven. |
thanks all for this thread, indeed skipping to v 3.11.0 saved the day for me |
protobuf-java
3.10.0
uses some Java 8 features which makes it incompatible with Android builds where minSdk < O, even with desugaring enabled.I realize that mobile clients are supposed to use protobuf lite, but some libraries (like Dialogflow client library) use
protobuf-java
internally, so we do not have a choice.What did you do?
Steps to reproduce the behavior:
ProtobufTest.zip
./gradlew assembleDebug
What did you expect to see
I expected build to succeed, like with protobuf-java
3.9.2
What did you see instead?
Build crashes with
MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O
error.The text was updated successfully, but these errors were encountered: