Android studio and Protobuf integration
<p>I have a project that need to use protobuf (Getting the objects from server and parsing them).<br>
For that I configured the following things:</p>

<p><strong>Project level <code>gradle.build</code></strong></p>

<pre><code>buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.0'
        classpath 'com.google.protobuf:protobuf-java:2.6.1'
    }
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
</code></pre>

<p><strong>App level <code>gradle.build</code></strong></p>

<pre><code>apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.protobuf'

android {
    ...
}

protobuf {
    protoc {
        artifact = 'com.google.protobuf:protoc:2.6.1'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
    compile 'com.google.protobuf:protobuf-java:2.6.1'
    compile 'com.google.protobuf:protobuf-gradle-plugin:0.7.0'
}
</code></pre>

<p>I put my <code>proto</code> file under <code>.../app/src/main/proto/FILE.proto</code>.<br>
Once i am trying to build the project I am getting the following error:</p>

<pre><code>Error:Execution failed for task ':app:generateDebugProto'.
&gt; protoc: stdout: . stderr: /Users/XX/YY/app/build/extracted-protos/main: warning: directory does not exist.
  /Users/XX/YY/app/build/extracted-include-protos/main: warning: directory does not exist.
  ...
  protoc-gen-javanano: program not found or is not executable
  --javanano_out: protoc-gen-javanano: Plugin failed with status code 1.
</code></pre>

<p>Any idea why is that? It should use the protoc from the repo and is should support that nano compilation.</p>

<p>Thanks.</p>