1. 错误详情
android studio使用grpc时,编译报No such property: javaCompilerTask for class: com.android.build.gradle.internal.variant.TestVariantData
错误的解决方案
2. gradle配置方案
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.5"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
当同步工程后就报No such property: javaCompilerTask for class: com.android.build.gradle.internal.variant.TestVariantData.
错误。
3. 解决方案
升级protobuf-gradle-plugin
版本为0.8.6
,以下为修改后的配置:
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.6"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
修改完之后,重新同步工程问题解决。