Я пытаюсь использовать бета-библиотеку Google Speech (google.cloud.speech.v1p1beta1.Speech) в проекте Android.Пример проекта работает.
Не удается распознать строку "import com.google.cloud.speech.v1p1beta1.SpeechGrpc;"
Вставлены ссылки на новые библиотеки в модуле-приложении build-gradle:
com.google.cloud:google-cloud-speech:0.62.0-beta
com.google.api.grpc:grpc-google-cloud-speech-v1p1beta1:0.39.0
Что-нибудь еще, что мне нужно сослаться или изменить, чтобы обойти эту проблему?
Build-Gradle (Module-App):
apply plugin: 'com.android.application'
apply plugin: 'com.google.protobuf'
ext {
supportLibraryVersion = '25.4.0'
grpcVersion = '1.4.0'
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
defaultConfig {
applicationId "com.google.cloud.android.vuspeech"
targetSdkVersion 22
versionCode 1
versionName '1.0'
}
signingConfigs {
release {
storeFile file(project.properties.storeFile)
storePassword project.properties.storePassword
keyAlias project.properties.keyAlias
keyPassword project.properties.keyPassword
}
}
productFlavors {
dev {
// Minimum version with platform multi-dex support
minSdkVersion 21
}
prod {
// Minimum version that can run gRPC (TLS extension)
minSdkVersion 16
}
}
buildTypes {
debug {
minifyEnabled false
multiDexEnabled true
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.2'
resolutionStrategy.force "com.android.support:support-annotations:$supportLibraryVersion"
}
}
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.3.0'
}
plugins {
javalite {
artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0"
}
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all().each { task ->
task.plugins {
javalite {}
grpc {
// Options added to --grpc_out
option 'lite'
}
}
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// Support libraries
compile "com.android.support:design:$supportLibraryVersion"
compile "com.android.support:cardview-v7:$supportLibraryVersion"
compile "com.android.support:recyclerview-v7:$supportLibraryVersion"
// gRPC
compile "io.grpc:grpc-okhttp:$grpcVersion"
compile "io.grpc:grpc-protobuf-lite:$grpcVersion"
compile "io.grpc:grpc-stub:$grpcVersion"
compile 'javax.annotation:javax.annotation-api:1.2'
protobuf 'com.google.protobuf:protobuf-java:3.3.1'
// OAuth2 for Google API
compile('com.google.auth:google-auth-library-oauth2-http:0.7.0') {
exclude module: 'httpclient'
}
// Google Cloud Speech beta
compile('com.google.cloud:google-cloud-speech:0.62.0-beta')
compile('com.google.api.grpc:grpc-google-cloud-speech-v1p1beta1:0.39.0')
// Tests
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
}