Tink is not compatible with protobuf-java to v4.26.0
Describe the bug:
Tink is not compatible with protobuf-java v4.26.0 due to a class being renamed. Attempting to initialize Tink when using protobuf v4.26.0 results in this error
java.lang.ExceptionInInitializerError: Exception java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessageV3
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
at com.google.crypto.tink.hybrid.EciesAeadHkdfPublicKeyManager.<init>(EciesAeadHkdfPublicKeyManager.java:43)
at com.google.crypto.tink.hybrid.HybridConfig.<clinit>(HybridConfig.java:44)
... 83 more
What version of Tink are you using? 1.12.0
By upgrading to protobuf-java 4.x, Tink is no longer compatible with protobuf-java 3.x. Most of the Java ecosystem is still using protobuf-java 3.x due to binary breaking changes in protobuf-java 4.x.
It seems like protobuf-java has committed to preserving backwards compatibility in order to allow consumers to upgrade, but this work is not yet complete.
https://github.com/protocolbuffers/protobuf/issues/16452
https://github.com/protocolbuffers/protobuf/issues/17247
Can we downgrade protobuf-java to the latest 3.x until this work is complete? Otherwise consumers will likely be prevented from taking Tink upgrades.
We released the [email protected] patch release which downgrades Protobuf to 25.3.