Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

as a practicumer, i was tasked to work on MyTracks app. and I am currently working on the source code i found here .. when i imported the code to android studio, i got 3 errors on Sensor.java -- a class that has this statement

// Generated by the protocol buffer compiler. DO NOT EDIT! // source: proto/sensor.proto

and these are the ff errors:

  • error: method parseUnknownField in class Builder cannot be applied to given types; required: CodedInputStream,CodedOutputStream,ExtensionRegistryLite,int found: CodedInputStream,ExtensionRegistryLite,int reason: actual and formal argument lists differ in length where MessageType,BuilderType are type-variables: MessageType extends GeneratedMessageLite declared in class Builder BuilderType extends Builder declared in class Builder

  • error: method parseUnknownField in class Builder cannot be applied to given types; required: CodedInputStream,CodedOutputStream,ExtensionRegistryLite,int found: CodedInputStream,ExtensionRegistryLite,int reason: actual and formal argument lists differ in length where MessageType,BuilderType are type-variables: MessageType extends GeneratedMessageLite declared in class Builder BuilderType extends Builder declared in class Builder

  • Error:Execution failed for task ':myTracksLib:compileReleaseJavaWithJavac'.

    Compilation failed; see the compiler error output for details.

    I hope you guys would help me out on this one because i badly need to get this right. Thank you for any help you could offer.

    In all likelihood, the version of protoc (the protobuf code generator tool) which generated Sensor.java is different from the version of libprotobuf.jar that you're trying to compile against. These two things must be exactly the same version. You will either need to regenerate Sensor.java using a version of protoc matching your libprotobuf.jar or you will need to find a version of libprotobuf.jar matching the protoc which generated Sensor.java .

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question . Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers .

  •