Android Studio and protobuf Error:(7, 0) Plugin with id 'com.google.protobuf' not found
<p>I want to use grpc in Android Studio, but failed in gradle setting.</p>

<p>my gradle plugin version is 2.1.2. I have installed gradle 2.14.</p>

<p>In my app\build.gradle file:</p>

<pre><code>    apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    apply plugin: "com.google.protobuf"

    defaultConfig {
        applicationId "com.example.test.test_20"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
            jniDebuggable true
        }
    }

    buildscript {
        repositories {
            maven {
                mavenCentral()
            }
        }
        dependencies {
            classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.0"
        }
    }


    protobuf {
        protoc {
            // The version of protoc must match protobuf-java. If you don't depend on
            // protobuf-java directly, you will be transitively depending on the
            // protobuf-java version that grpc depends on.
            artifact = "com.google.protobuf:protoc:3.0.0"
        }
        plugins {
            grpc {
                artifact = 'io.grpc:protoc-gen-grpc-java:1.0.0'
            }
        }
        generateProtoTasks {
            all()*.plugins {
                grpc {}
            }
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'io.grpc:grpc-okhttp:1.0.0'
    compile 'io.grpc:grpc-protobuf-lite:1.0.0'
    compile 'io.grpc:grpc-stub:1.0.0'
}
</code></pre>

<p>Gradle sync message output is 
Error:(7, 0) Plugin with id 'com.google.protobuf' not found.</p>

<p>What is wrong in my setting? </p>

<p>I create a new empty project, and app/build.gradle file:</p>

<pre><code>apply plugin: 'com.android.application'
apply plugin: "com.google.protobuf"

buildscript {
    repositories {
        maven {
            //mavenCentral()
            url 'https://repo1.maven.org/maven2'
        }
    }
    dependencies {
        classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.0"
    }
}

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.example.test.testprotobuf"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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'
}
</code></pre>

<p>And gradle-wrapper.properties file:</p>

<pre><code>distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip
</code></pre>

<p>I excute "gradlew build" command successfully. 
And sync gradle, it prompt that “Error:(2, 0) Cause: org/gradle/api/internal/file/collections/DefaultDirectoryFileTreeFactory
” 。</p>