Android 找到多个文件 OS 独立路径 'google/protobuf/type.proto'

Android More than one file was found with OS independent path 'google/protobuf/type.proto'

我想将 com.google.firebase:firebase-admin:7.1.1 添加到我的项目中

同步后,出现以下错误:

* What went wrong:
Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> More than one file was found with OS independent path 'google/protobuf/type.proto'

我使用这个教程:https://firebase.google.com/docs/firestore/quickstart

此外,我添加了这一部分:

packagingOptions {
        exclude 'project.properties'
        exclude 'META-INF/INDEX.LIST'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/native-image/io.netty/codec-http/native-image.properties'
        exclude 'META-INF/io.netty.versions.properties'
        exclude 'META-INF/native-image/io.netty/common/native-image.properties'
        exclude 'META-INF/native-image/io.netty/transport/native-image.properties'
        exclude 'META-INF/native-image/io.netty/transport/reflection-config.json'
        exclude 'META-INF/native-image/io.netty/buffer/native-image.properties'
        exclude 'META-INF/native-image/io.netty/handler/native-image.properties'
    }

尝试添加以下代码可能会有帮助:

 exclude("google/protobuf/type.proto")   

你可以参考这个