Java Protobuff java.lang.VerifyError [英] Java Protobuff java.lang.VerifyError

查看:72
本文介绍了Java Protobuff java.lang.VerifyError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用 protobuff 2.5.0,当我尝试使用 protofbuff 生成的 java 类时,我收到以下错误.

I am using the protobuff 2.5.0 in my project and when i try to use the protofbuff generated java classes, i am getting the below error.

java.lang.VerifyError: class com.test.PersonModel$Person overrides final method getUnknownFields.()Lcom/google/protobuf/UnknownFieldSet;

推荐答案

由于不同的 protobuf 版本(2.4.0 和 2.5.0)之间不兼容,我遇到了这个问题.protobuf 的使用者期望 2.4.0 ,但实际的类是从 protobuf 2.5.0 生成的.使用 protobuf 2.4.0 重新生成 java 类后解决了这个问题.

I was getting this issue due to incompatibility between the different protobuf versions (2.4.0 and 2.5.0). The consumer of protobuf was expecting 2.4.0 , but the actual classes were generated out of protobuf 2.5.0. After regenerating the java classes using protobuf 2.4.0 resolved the issue.

这篇关于Java Protobuff java.lang.VerifyError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆