You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android集成Dialogflow与Firebase Firestore出现PROTOBUF重复类错误求助

应用开发与问题概述
  • 开发场景:基于Java语言编写Android应用,已完成Firebase Firestore集成,当前正尝试接入Dialogflow能力
  • 构建报错:完成全部配置后,触发重复类检测错误,com.google.api.Advice类同时存在于两个编译模块中:
    • jetified-proto-google-common-protos-2.0.1,对应传递依赖com.google.api.grpc:proto-google-common-protos:2.0.1
    • jetified-protolite-well-known-types-17.1.1-runtime,对应传递依赖com.google.firebase:protolite-well-known-types:17.1.1
当前build.gradle相关依赖配置
// Firebase 相关依赖
implementation 'com.google.firebase:firebase-core:18.0.2'

// Dialogflow 相关依赖
implementation 'com.google.cloud:google-cloud-dialogflow:2.5.0'
implementation 'io.grpc:grpc-okhttp:1.36.0'
implementation 'io.grpc:grpc-stub:1.36.0'
compileOnly 'org.apache.tomcat:annotations-api:6.0.53'
implementation 'io.grpc:grpc-protobuf-lite:1.36.0'
已尝试的调整方案及存在问题
  • 先后测试了多组依赖版本组合,其中核心调整为配置全局依赖排除规则:
    configurations {
      compile.exclude module: 'protolite-well-known-types'
      compile.exclude module: 'protolite-proto-google-common-protos'
      compile.exclude module: 'protobuf-javalite'
    }
    
    调整后Dialogflow可正常运行,但Firebase Firestore功能失效
  • 该重复类冲突曾在Firebase Android SDK的公开问题追踪列表中被提及,截至发帖时尚未得到官方修复
  • 尝试引入com.google.protobuf 0.8.15版本插件适配protobuf构建流程,存在兼容性问题,无法正常完成构建
具体诉求

请求提供可同时兼容Firebase Firestore与Dialogflow依赖的稳定配置方案


内容的提问来源于stack exchange,提问作者JrDev

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.11.01 11:36:05