NoClassDefFoundError: Failed resolution of: Lcom/google/protobuf/ByteString;
问题:
在使用一个升级的bitcoinj库的时候编译出现了这个错误,原因是这个库里面使用了Protobuf去序列化,
解决:
1.在project 下的build中添加:
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.2'
}
2.在app 的build 下面添加:
apply plugin: 'com.google.protobuf'
dependencies{
compile 'com.google.protobuf:protobuf-java:3.1.0'
compile 'com.google.protobuf:protoc:3.1.0'
}