grpc AS编译报No such property: javaCompilerTask for class错误

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
}

修改完之后,重新同步工程问题解决。

以上解决方案来自https://github.com/grpc/grpc-java/issues/5211

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值