I'm trying to generate .java files from the .proto files I have stored under my SRC folder in Android studio. I put the below code in my gradle file by it doesn't seem to work
apply plugin: 'com.squareup.wire'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.squareup.wire:wire-maven-plugin:2.1.1'
}
}
So instead of using a gradle plugin I just ended up using the square wire compiler jar. Here are the steps.
Go to the directory and paste this command
java -jar wire-compiler-2.1.1-jar-with-dependencies.jar --proto_path=directory-of-protofile --java_out=app/src/main/java/ name-of-file.proto
Should work. Make sure to replace the directory-of-protofile
and name-of-file
with whatever you have.