我上个月在这个位置复制并编译了speech api的源代码https://github.com/GoogleCloudPlatform/android-docs-samples/tree/master/speech/Speech 和作品。现在,当我重新访问它时,我遇到了一个Configuration with name 'debugAndroidTestCompile' not found.错误。
这是什么原因造成的?如果你问我怎么知道是那个,我做了排除法。我在 gradle 文件上一一删除并同步。当我删除 apply plugin: 'com.google.protobuf' 时,错误消失了。
最佳答案
将 protobuf 版本更新到 build.gradle 中的最新版本。目前是0.8.8,从GitHub仓库查看最新版本Protobuf Plugin for Gradle .
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
}
}
关于android - Google Cloud Speech API protobuf 导致找不到 'debugAndroidTestCompile',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49772940/