我正在使用 firebase firestore 和云语音转文本 API 构建一个 android 应用程序。我发现 firestore 和 com.google.protobuf 之间存在“protobuf”冲突。因此,我在 app/build.gradle 中排除了“protolite-well-known-types”。这是我的应用程序/build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.protobuf'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.gigamole.sample"
minSdkVersion 23
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/INDEX.LIST'
}
configurations.all {
exclude group: 'com.google.protobuf', module: 'protobuf-lite'
}
}
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.3.0' …Run Code Online (Sandbox Code Playgroud)