apply plugin: 'java'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'io.grpc:grpc-okhttp:1.4.0'
compile 'io.grpc:grpc-protobuf-lite:1.4.0'
compile 'io.grpc:grpc-stub:1.4.0'
compile 'javax.annotation:javax.annotation-api:1.2'
}
sourceCompatibility = "1.7"
targetCompatibility = "1.7"
apply plugin: 'com.google.protobuf'
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.0.0'
}
plugins {
javalite {
artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0"
}
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.0.0' // CURRENT_GRPC_VERSION
}
}
generateProtoTasks {
all().each { task ->
task.plugins {
javalite {}
grpc {
// Options added to --grpc_out
option 'lite'
}
}
}
}
}
I copied hellowworld.proto to my module. Once I make the module, Android Studio gives error Duplicated class io.grpc.examples.helloworld.HelloReply. I searched the file explorer, the same class exists in build\generated\source\proto\main\java\io\grpc\examples\helloworld\HelloReply.java and D:\SimpleChat\protocol\build\generated\source\proto\main\javalite\io\grpc\examples\helloworld\HelloReply.java.
I checked the sample repository in https://github.com/grpc/grpc-java, it only has the java one.
How do I resolve this?
--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/2071b2d9-9168-4b20-83ec-769215328a83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
I already have
dependencies {
compile 'io.grpc:grpc-okhttp:1.4.0'
compile 'io.grpc:grpc-protobuf-lite:1.4.0'
compile 'io.grpc:grpc-stub:1.4.0'
compile 'javax.annotation:javax.annotation-api:1.2'
}
in build.gradle.
Am I still missing anything?
Can you try "./gradlew clean" and then rebuild? You can encounter this type of error when you've already built a project using one flavor of protobuf, then switch to another. The generated files from the old proto flavor are not always removed automatically, causing conflicts, but "./gradlew clean" will clear them out.Thanks,Eric
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/8c810d1e-727e-4df0-a046-431fde8f3ee9%40googlegroups.com.
Eric
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/a7429221-22be-4dbf-b81b-6fd5c4c4aa97%40googlegroups.com.