Protobuf android java integration "Cannot resolve method 'parseFrom(java.nio.ByteBuffer)'"

27 views
Skip to first unread message

Shwetha G

unread,
Nov 8, 2020, 11:16:42 PM11/8/20
to Protocol Buffers
I'm trying to integrate protocol buffer in android project and followed few steps to include gradle plugin and added following dependencies
dependencies {
implementation 'com.google.protobuf:protobuf-lite:3.0.0'
implementation 'com.google.protobuf:protobuf-java:3.10.0'
}

But in the generated java file, I have methods 
public static LoginRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}

where the highlighted line is showing error cannot resolve method. The whole file is generated from .proto file and i'm not sure why i'm getting this error even after including necessary plugins. 
Kindly help.

Reply all
Reply to author
Forward
0 new messages