1

I have define scala object(say, MyObject) which extends following

trait GeneratedMessageCompanion[A <: GeneratedMessage with Message[A]]

And when I call parseFrom method on the object, I get following error:

Caused by: java.lang.NoSuchMethodError:....MyObject$.parseFrom([B)Lscalapb/GeneratedMessage;

I tried both scalapb-runtime_2.11 and scalapb-runtime_2.12.

Edit: Issue is solved. It was case of dependency mismatches.

Mandroid
  • 6,200
  • 12
  • 64
  • 134
  • I am not sure it might be that protobuf doesn't support ```F-bounded polymorphism``` something to look into... – sinanspd Mar 19 '20 at 03:40
  • Can you share more information on how you build and run your code? Can you share the code for MyObject and how it's being called? How can this problem be reproduced? – thesamet Mar 19 '20 at 07:13
  • this problem often happens when your project has dependencies witch conflicts. Two ways to resolve it: using shading for conflicted dependencies or fat-jar (sbt assembly). https://github.com/sbt/sbt-assembly#shading – Boris Azanov Mar 19 '20 at 07:21

0 Answers0