Как настроить protobuf в студии Kotlin/Android?Android

Форум для тех, кто программирует под Android
Гость
Как настроить protobuf в студии Kotlin/Android?

Сообщение Гость »


Впервые использую protobuf, поэтому, следуя инструкциям Google, я поместил все свои .protos в папку protos в своем проекте студии Android. Я знаю, что файлы .proto настроены правильно. Я компилирую файлы из этой папки, используя:

Код: Выделить всё

protoc -I=. --java_out=. --kotlin_out=. filename.proto
This generates a bunch of kotlin and java files that look like what I am supposed to get. However, android studio throws a ton of errors and doesn't seem to like most of the code in those files.
So my question is there something additional I need to do with the setup, bring in a dependency in the gradle file? I saw an example like that but it seemed only relevant to the plugin for compiling using gradle - since I'm compiling from the command line I don't think I should need that?


Источник: https://stackoverflow.com/questions/722 ... oid-studio

Вернуться в «Android»