title: gRPC protobuf not compiling with kotlin builds (Android Studio 3.0)
body: <p>I created a gRPC project very similar to the example gRPC for android project at <a href="https://github.com/grpc/grpc-java/tree/master/examples/android/helloworld" rel="nofollow noreferrer">https://github.com/grpc/grpc-java/tree/master/examples/android/helloworld</a></p>
  
  <p>The first time I somehow got my own project with my own simple .proto file compiled without any errors. I just copy-and-pasted all important build.gradle parts. The following builds in which I changed my MainActivity <strong>Kotlin</strong> code worked as well.</p>
  
  <p>But now, that I have added a bit more to my .proto file, Gradle fails to build my project. The .proto file is correct and I already tried adding it as a dependency to compileDebugKotlin{} and compileReleaseKotlin{} but nothing worked. I get the following error message that the task <code>:generateDebugProto</code> is not defined.</p>
  
  <p>But I am confused because when I add a line break to my build.gradle and click <code>Sync now</code> in Android Studio the Gradle sync finishes successfully and in the gradle log I see the following lines:</p>
  
  <pre><code>:app:extractDebugProto
  :app:extractIncludeDebugProto
  :app:extractProto
  :app:generateDebugProto
  </code></pre>
  
  <p><strong>Am I doing anything wrong?</strong></p>
  
  <hr>
  
  <p>My project build.gradle</p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      ext.kotlin_version = '1.2.0'
      repositories {
          google()
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.0.1'
          classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
          classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.3"
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
          mavenCentral()
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <p>My module-level build.gradle</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  apply plugin: 'kotlin-android'
  
  apply plugin: 'kotlin-android-extensions'
  
  apply plugin: 'com.google.protobuf'
  
  android {
      compileSdkVersion 26
      ext.buildType =  ""
      defaultConfig {
          applicationId "com.my.appr"
          minSdkVersion 15
          targetSdkVersion 26
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              buildType = "Release"
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
          debug {
              buildType = "Debug"
          }
      }
      sourceSets {
          debug.java.srcDirs += 'build/generated/source/proto/debug/java'
          debug.java.srcDirs += 'build/generated/source/proto/debug/grpc'
          debug.java.srcDirs += 'build/generated/source/proto/debug/javalite'
          release.java.srcDirs += 'build/generated/source/proto/release/java'
          release.java.srcDirs += 'build/generated/source/proto/release/grpc'
          release.java.srcDirs += 'build/generated/source/proto/release/javalite'
          main.proto.srcDirs += 'src/main/proto'
      }
      //preBuild.dependsOn(":generateDebugProto")
  }
  
  
  protobuf {
      protoc {
          artifact = 'com.google.protobuf:protoc:3.5.0'
      }
      plugins {
          javalite {
              artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0"
          }
          grpc {
              artifact = 'io.grpc:protoc-gen-grpc-java:1.8.0' // CURRENT_GRPC_VERSION
          }
      }
      generateProtoTasks {
          all().each { task -&gt;
              task.plugins {
                  javalite {}
                  grpc {
                      // Options added to --grpc_out
                      option 'lite'
                  }
              }
          }
      }
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
      implementation 'com.android.support:appcompat-v7:26.1.0'
      implementation 'com.android.support.constraint:constraint-layout:1.0.2'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.1'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
      implementation 'io.grpc:grpc-okhttp:1.8.0' // CURRENT_GRPC_VERSION
      implementation 'io.grpc:grpc-protobuf-lite:1.8.0' // CURRENT_GRPC_VERSION
      implementation 'io.grpc:grpc-stub:1.8.0' // CURRENT_GRPC_VERSION
      implementation 'javax.annotation:javax.annotation-api:1.2'
  }
  
  
  //preBuild.dependsOn ":generate"+buildType+"proto"
  </code></pre>