Questions tagged [square-wire]

Wire is a Java implementation of Google's Protocol Buffers.

Filter by
Sorted by
Tagged with
189 votes
33 answers
84k views

Android Studio inline compiler showing red errors, but compilation with gradle works fine

I've set up my project in Android Studio to use the Square Wire library, as per this question. Build -> Compile Project works fine. 2:03:10 PM Compilation completed successfully in 31 sec However, ...
1 vote
0 answers
104 views

Colon in grpc url while using wire

I'm trying to make a call to grpc syntax URL: https://photoslibrary.googleapis.com/v1/mediaItems:search by using Wire framework. First problem is putting /v1 in path as below configuration ignores it:...
2 votes
1 answer
164 views

Need wire to emit interfaces for client and server in same gradle project

I want to use interfaces for both client and server in the same android app. Usecase is to run a okhttpmockwebserver serving gRPC requests within the same app the client is running in. For this i ...
-1 votes
1 answer
133 views

Square Wire Service Implementation

I'm trying to learn about grpc and protocol buffers while creating a test app using square's wire library. I've got to the point of generating both client and server files but I got stuck in creating ...
3 votes
1 answer
297 views

Does Wire have an equivalent to io.grpc.Metadata and MetadataUtils for attaching headers to calls dynamically?

For instance, attaching Metadata to a stub as headers would look something like val stub = MetadataUtils.attachHeaders( SomeCoroutineGrpc.newStubWithContext(channel), ...
1 vote
1 answer
283 views

How use Wire with Flow in client gRPC?

i need stream of a service gRPC with Wire and need use Flow on client, but executeBlocking() do not provide method with return via Flow, need implementation manual via flow emits?
3 votes
2 answers
776 views

Using protobuf imports (i.e. google/protobuf/timestamp.proto) with wire

I am trying to generate files using the square's Wire. I could run their sample all good, but as soon as I added import "google/protobuf/timestamp.proto"; to their .proto file to check how wire ...
1 vote
1 answer
3k views

How can I generate protobuf in Kotlin for Android applications?

Anyone help me to understand how can I generate protobuf in Kotlin? I heard about gRPC, wire, KotlinPoet, but I don't understand what are the differences, which one should I use any samples, any ...
1 vote
1 answer
274 views

Unable to resolve x imports

I am getting (using: api 'com.squareup.wire:wire-runtime:3.0.2') Execution failed for task ':app:generateProtos'. unable to resolve 1 imports: testing/tastes/tastes.proto searching 0 proto paths: My ...
0 votes
1 answer
156 views

How do I serialize with square-wire

Getting a NullPointerException when I try to serialize the result: java.lang.NullPointerException: Attempt to invoke virtual method 'byte[] com.squareup.wire.ProtoAdapter.encode(java.lang.Object)' on ...
3 votes
1 answer
244 views

D8 exception when using Square's Wire

After adding Square's Wire library for Protobuf support in an Android project, I'm getting the following D8 exception during compilation: D8: Program type already present: com.google.protobuf....
1 vote
1 answer
619 views

Proguard for Wire + Retrofit NoSuchMethodException

My brain is fried. I searched S.O. for help but it seems Proguard issues with this exception are specific to the app in question. I've been trying to use Proguard to obfucate/minify my app and when I ...
2 votes
0 answers
378 views

How to generate a .proto file with Wire without using Maven?

For a project I've been using the Google protocol buffers, but now I want to switch to Wire. I want to compile my .proto file using the terminal like this protoc -I=$SRC_DIR --java_out=$DST_DIR $...
1 vote
0 answers
102 views

java.lang.IllegalArgumentException: No WireType for value

use com.squareup.wire wire-runtime. code: Wire wire = new Wire(); VerifyTicketRsp ticketRsp = wire.parseFrom(moaResult.objectBytes, VerifyTicketRsp.class); error info: java.lang....
0 votes
1 answer
2k views

Best way to add dependency for Wire using Gradle in Android Studio

I'm using Square's Wire library for my Android app, using Android Studio with Gradle. I originally added the wire-runtime-1.2.0.jar into a libs folder in my module, and added the dependency to Gradle ...