Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
65 views

List of protobuf messages to JSON array

I have a protobuf message definition like this: message MyThing { string foo = 1; int32 bar = 2; } And a Java/Kotlin API that returns a List<MyThing> I need to format this as a JSON string, ...
Patrick Johnson's user avatar
0 votes
1 answer
66 views

Skip Proto file Binding classes generation if already present in AAR file or any other source

I have one AAR file added inside the libs directory in Android Studio project. I have added a proto compiler configurations inside the build.gradle file. I am trying to add a proto file inside the app ...
Satyam Gondhale's user avatar
4 votes
1 answer
485 views

Does Protobuf JavaLite support google.protobuf.Struct / google.protobuf.Value?

Here is the proto message that we trying to send. message Cta { string title = 1; string pid = 2; google.protobuf.Struct params = 3; } Does protobuf-lite library which is recommended for ...
Sudev Ambadi's user avatar
8 votes
0 answers
620 views

Protobuf (version3) optional field are not nullable in kotlin generated code

I don't understand why an optional field (like middle_name in the example below), is not nullable in the Kotlin generated representation while in Golang and Rust it is properly nullable (or optional). ...
n3wtron's user avatar
  • 133
0 votes
2 answers
336 views

How to: ProtoBuf: get the parent message

Given a message (b of type B), nested in another (a of type A); how does one get ‘a’? I was hoping for something like ‘b.getParent()’. message B { optional string name = 1; repeated B b = 2; } ...
phreed's user avatar
  • 1,859
0 votes
1 answer
1k views

grpc kotlin plugin is not generating dsl code

I have an existing project which is using gradle with kotlin DSL. I have setup protobuf code auto-generation with gradle build. Kotlin grpc code is generated and I am able to implement my backend ...
Gopinath's user avatar
  • 13.1k
3 votes
0 answers
2k views

Once I added firebase dependency and got duplicated protobuf classes error

Everything is working fine once I added the below dependencies in the Gradle getting the below error dependency : implementation 'com.google.firebase:firebase-perf:19.1.0' Error: Duplicate class com....
Mahi's user avatar
  • 1,784
2 votes
1 answer
965 views

In protobuf can I constrain a map's key to certain values?

So protobuf does not allow string enums to be keys in a map I want to constrain a map to only have the keys a, b, or c. I'm working in Kotlin and can use validators like [(validate.rules).string = {...
spacether's user avatar
  • 2,669
5 votes
1 answer
2k views

Protobuf "Unresolved reference" with generated classes in Android Studio using Kotlin

it's my first time diving in with protobuf and jetpack's DataStore but I've encountered an issue which is quite confusing. I've created my .proto file in src/main/java/proto, it's really simple: ...
Bonfi's user avatar
  • 131
3 votes
1 answer
1k views

NoSuchMethod error on dealing with protobuf classes in a unit test

I'm trying to write unit tests of classes with using protobuf models and run them in Android Studio. For example this is a simple converter test class UpdateConfigConverterTest { private val ...
Beloo's user avatar
  • 9,915
1 vote
2 answers
8k views

Kotlin Data Classes support in Protobuf

I am implementing protobuf recently in our kotlin project. I am receiving the binary data and deserialising it to Proto object using the proto file. But I would like have that converted to data ...
srisindhu saride's user avatar