nbroeking
nbroeking

Reputation: 8908

Android Studio can't build Google Protobuf generated files

I have been working with google protocol buffers in this project for about 6 months now. All of a sudden out of no where I started getting errors when building my android project.

Error:(873, 45) error: cannot find symbol method writeString(CodedOutputStream,int,Object)

Error:(876, 77) error: cannot find symbol method getRaw(int)

Error:(886, 53) error: cannot find symbol method computeStringSize(int,Object)

Error:(891, 54) error: cannot find symbol method getRaw(int)

Error:(1938, 47) error: cannot find symbol method writeString(CodedOutputStream,int,Object)

Error:(1952, 55) error: cannot find symbol method computeStringSize(int,Object)

Error:(4605, 45) error: cannot find symbol method writeString(CodedOutputStream,int,Object)

Error:(4636, 53) error: cannot find symbol method computeStringSize(int,Object)

My build.grade looks like

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile files('libs/protobuf-java-3.0.0.jar')
    compile files('libs/GraphView-4.0.1.jar')
}

When I run proton --version it says 3.0.0

Up until a day ago everything was building. What did I do and how do I fix this?

Upvotes: 2

Views: 2015

Answers (1)

psv
psv

Reputation: 697

Most likely you upgraded to Proto3, which has some breaking changes. If this is the case you might try to downgrade again and that should solve your problem.

Upvotes: 2

Related Questions