protocol-buffers

Updated firebase dependency and got duplicated protobuf classes error

送分小仙女□ 提交于 2021-02-20 05:39:29
问题 I'm getting this error after updating one of my firebase SDKs FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'. > 1 exception was raised by workers: java.lang.RuntimeException: Duplicate class com.google.protobuf.AbstractMessageLite found in modules jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1) Duplicate

Updated firebase dependency and got duplicated protobuf classes error

被刻印的时光 ゝ 提交于 2021-02-20 05:38:04
问题 I'm getting this error after updating one of my firebase SDKs FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'. > 1 exception was raised by workers: java.lang.RuntimeException: Duplicate class com.google.protobuf.AbstractMessageLite found in modules jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1) Duplicate

How to use google protobuf in a project with precompiled headers

*爱你&永不变心* 提交于 2021-02-18 13:53:18
问题 I have a solution which contains several projects. My projects (but not all of them) use precompiled headers. I decided to use protobuf and I've met a problem. After generetaing *.pb.h from *.proto by protoc.exe I'm trying to include the header and get the error - precompiled header wasn't included into *.pb.h. How I can solve this problem? I have an idea (but I don't like it at all) - after protoc generates *.pb.h I can run some script, which'll include my precompiled header into the *.pb.h.

Nanopb without callbacks

杀马特。学长 韩版系。学妹 提交于 2021-02-11 17:58:24
问题 I'm using Nanopb to try and send protobuf messages from a VxWorks based National Instruments Compact RIO (9025). My cross compilation works great, and I can even send a complete message with data types that don't require extra encoding. What's getting me is the callbacks. My code is cross compiled and called from LabVIEW and the callback based structure of Nanopb seems to break (error out, crash, target reboots, whatever) on the target machine. If I run it without any callbacks it works great

How to access unknown fields - python protobuf

一曲冷凌霜 提交于 2021-02-10 14:46:17
问题 I am working with a large number of message types with similar but not identical structure. All the stuff that's common among these is in another message. When a message comes in, I parse it using the common message type. However, I can't seem to find a way to access the fields outside of this type (i.e. the non-common fields). Is there a way to access the unknown field set in python? Edit: I just saw this in the documentation: " If a message has unknown fields, the current Java and C++

How to access unknown fields - python protobuf

爷,独闯天下 提交于 2021-02-10 14:42:12
问题 I am working with a large number of message types with similar but not identical structure. All the stuff that's common among these is in another message. When a message comes in, I parse it using the common message type. However, I can't seem to find a way to access the fields outside of this type (i.e. the non-common fields). Is there a way to access the unknown field set in python? Edit: I just saw this in the documentation: " If a message has unknown fields, the current Java and C++

Protocol Buffer import resolution

霸气de小男生 提交于 2021-02-10 06:14:40
问题 Before reading through this rather long question, I've raised a bug https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1103. The documentation for Proto Packages and Name Resolution states You can use definitions from other .proto files by importing them. To import another .proto's definitions, you add an import statement to the top of your file. My example.proto depends on annotations.proto to transcode HTTP/JSON to gRPC. This is a trivial example, but note I use the import

How to create GRPC client directly from protobuf without compiling it into java code

孤人 提交于 2021-02-08 06:29:14
问题 When working with GRPC, we need to generate the gRPC client and server interfaces from our .proto service definition via protocol buffer compiler (protoc) or using Gradle or Maven protoc build plugin. Flow now: protobuf file -> java code -> gRPC client. So, is there any way to skip this step? How to create a generic GRPC client that can call the server directly from the protobuf file without compile into java code? Or, is there a way to Generated Code at runtime? Flow expect: protobuf file ->

using google protobuffers reflection in python

狂风中的少年 提交于 2021-02-07 18:12:50
问题 How can I programatically set a field value by its name for a google protobuffer object in python. I've checked the documentation and API, but its just not clear to me, and I haven't been able to find any examples. I'd like to do do something like: protoBufObj.set_field('foo', 42) Thanks. 回答1: If you've got any Python object where x.foo = 42 works, setattr(x, 'foo', 42) should have precisely the same effect. This is a built-in Python function, nothing to do with protobuffers. 来源: https:/

using google protobuffers reflection in python

℡╲_俬逩灬. 提交于 2021-02-07 18:12:28
问题 How can I programatically set a field value by its name for a google protobuffer object in python. I've checked the documentation and API, but its just not clear to me, and I haven't been able to find any examples. I'd like to do do something like: protoBufObj.set_field('foo', 42) Thanks. 回答1: If you've got any Python object where x.foo = 42 works, setattr(x, 'foo', 42) should have precisely the same effect. This is a built-in Python function, nothing to do with protobuffers. 来源: https:/