I have been trying to find a way to integrate java code, generated by google-protobuf's protoc compiler, into an Android Studio project.
protoc --java_out=. Navigation.proto
where Navigation.proto contains:
syntax = "proto3";
option java_generic_services = true;
message Navigation {
string name = 1;
string url = 2;
}
service NavRPC {
rpc putNavigation(Navigation) returns (Navigation);
};
will generate a java class (Navigation.java), but that class references packages that are not present in the list of libraries (application or external) within Android Studio.
I tried installing the libraries from maven central through the dependencies tab of Project Structure, in Android Studio - but I keep getting error messages that include:
Error:(116, 79) error: incompatible types: IOException cannot be converted to String
Error:(261, 36) error: cannot find symbol method parseWithIOException(Parser<NavDrawerElement>,InputStream)
Error:(266, 36) error: cannot find symbol method parseWithIOException(Parser<NavDrawerElement>,InputStream,ExtensionRegistryLite)
Error:(269, 36) error: cannot find symbol method parseDelimitedWithIOException(Parser<NavDrawerElement>,InputStream)
Error:(274, 36) error: cannot find symbol method parseDelimitedWithIOException(Parser<NavDrawerElement>,InputStream,ExtensionRegistryLite)
Error:(278, 36) error: cannot find symbol method parseWithIOException(Parser<NavDrawerElement>,CodedInputStream)
Being somewhat new to Java, Android Studio, and Maven -- I am not sure why the errors are happening. The libraries show up in the external-libraries list but I keep getting unresolved dependencies and errors that would seem to indicate otherwise.