Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android and grpc-protobuf-lite support #25

Closed
bob04619 opened this issue Jan 16, 2019 · 4 comments
Closed

Android and grpc-protobuf-lite support #25

bob04619 opened this issue Jan 16, 2019 · 4 comments

Comments

@bob04619
Copy link

bob04619 commented Jan 16, 2019

Hi, is the client gRPC generator suitable for Android?

I tested per example project and documentation instructions and it's leaking the full grpc-protobuf dependency on the runtime classpath.

+--- com.github.marcoferrer.krotoplus:kroto-plus-coroutines:0.2.2-RC1
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.11
|    |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.11
|    |    \--- org.jetbrains:annotations:13.0
|    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0
|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.11 (*)
|    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.1.0
|    |         \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.11
|    +--- io.grpc:grpc-protobuf:1.15.1
|    |    +--- io.grpc:grpc-core:1.15.1
|    |    |    +--- io.grpc:grpc-context:1.15.1
|    |    |    +--- com.google.code.gson:gson:2.7
|    |    |    +--- com.google.guava:guava:20.0
|    |    |    +--- com.google.errorprone:error_prone_annotations:2.2.0
|    |    |    +--- com.google.code.findbugs:jsr305:3.0.0
|    |    |    +--- org.codehaus.mojo:animal-sniffer-annotations:1.17
|    |    |    +--- io.opencensus:opencensus-api:0.12.3
|    |    |    |    \--- com.google.errorprone:error_prone_annotations:2.2.0
|    |    |    \--- io.opencensus:opencensus-contrib-grpc-metrics:0.12.3
|    |    |         +--- com.google.errorprone:error_prone_annotations:2.2.0
|    |    |         \--- io.opencensus:opencensus-api:0.12.3 (*)
|    |    +--- com.google.protobuf:protobuf-java:3.5.1
|    |    +--- com.google.guava:guava:20.0
|    |    +--- com.google.api.grpc:proto-google-common-protos:1.0.0
|    |    \--- io.grpc:grpc-protobuf-lite:1.15.1
|    |         +--- io.grpc:grpc-core:1.15.1 (*)
|    |         \--- com.google.guava:guava:20.0
|    \--- io.grpc:grpc-stub:1.15.1
|         \--- io.grpc:grpc-core:1.15.1 (*)
\--- junit:junit:4.12
     \--- org.hamcrest:hamcrest-core:1.3
@marcoferrer
Copy link
Owner

marcoferrer commented Jan 17, 2019

There shouldnt be any compatibility issues with the protobuf-lite runtime. To help out, I set up a protobuf-lite example configuration in the template project. If you encounter any issues please let me know.

You're right about the issue with the dependency polluting the classpath so Ill be sure to take care of that in the next release. In the mean time you can configure gradle to exclude the transitive grpc-protobuf.

dependencies {   
    implementation ("com.github.marcoferrer.krotoplus:kroto-plus-coroutines:$krotoplus_version"){
        exclude group: 'io.grpc'
    }
}

Thanks for the heads up!

@bob04619
Copy link
Author

Great, thanks. Our protobuf {} block for lite generation looks the exact same as what you ended up with. We'll run some client tests.

I don't quite envision how people will use your template if both the server and client use the same dependencies. e.g., For our stuff we use full io.grpc dependencies on server and *-lite on android. Also, as recommended by Google for the transport dependency we use this for Android:

implementation "io.grpc:grpc-okhttp:xxx"

and this for the server:

implementation "io.grpc:grpc-netty:xxx "

Thanks

@marcoferrer
Copy link
Owner

The example templates provided werent targeting the android runtime specifically. Thats why the client and server both use io.grpc:grpc-netty. The latest RC has removed the grpc-protobuf dependency from the coroutine runtime, so you shouldn't need to exclude it explicitly anymore.

@davidbilik
Copy link

Hello, do you have example android project that is setup using kroto?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants