当前位置: 首页 > 知识库问答 >
问题:

Firebase Android:在模块中发现重复的Protobuf类

唐茂实
2023-03-14
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
apply plugin: 'project-report'


android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.my.app"
        minSdkVersion 23
        targetSdkVersion 28
        multiDexEnabled true
        compileOptions {
            sourceCompatibility 1.8
            targetCompatibility 1.8
        }

        //Optionally configure your OneSignal IDs below
        manifestPlaceholders = [manifestApplicationId          : "${applicationId}",
                                onesignal_app_id               : "",
                                onesignal_google_project_number: ""]
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }

        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                    'proguard-rules.txt'
        }
    }
    dexOptions {
        jumboMode true
        javaMaxHeapSize "4g"
    }
}

repositories {
    flatDir {
        dirs 'libs'
    }
    maven {
        url "https://jitpack.io"
    }
    jcenter()
}

configurations {
    //Exclusions that I've tried
    //implementation.exclude module:'protolite-well-known-types'
    //implementation.exclude module:'guava'
    //implementation.exclude module:'protobuf-javalite'
    //implementation.exclude module:'proto-google-common-protos'
}

dependencies {
    implementation 'com.devbrackets.android:exomedia:4.3.0' //TV
    implementation 'com.google.android.exoplayer:exoplayer:2.9.6' //TV & Radio
    implementation 'com.cleveroad:audiovisualization:1.0.1' //Radio
    implementation 'com.google.code.gson:gson:2.8.5' //WC
    implementation 'com.squareup.okhttp3:okhttp:3.12.1'
    implementation 'org.jsoup:jsoup:1.8.3'
    implementation 'com.onesignal:OneSignal:3.12.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.duolingo.open:rtl-viewpager:1.0.2'
    implementation 'com.github.chrisbanes:PhotoView:1.3.0'
    implementation 'androidx.multidex:multidex:2.0.1'

    implementation 'androidx.multidex:multidex-instrumentation:2.0.0'
    implementation 'androidx.exifinterface:exifinterface:1.2.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'com.google.android.material:material:1.2.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.legacy:legacy-support-core-utils:1.0.0'
    implementation 'androidx.media:media:1.1.0'

    implementation "com.google.android.gms:play-services-oss-licenses:17.0.0"
    implementation "com.google.android.gms:play-services-gcm:17.0.0"
    implementation "com.google.android.gms:play-services-ads:19.3.0"
    implementation "com.google.android.gms:play-services-maps:17.0.0"
    //noinspection GradleDynamicVersion
    implementation 'com.google.maps.android:android-maps-utils:0.5+'
    implementation 'com.google.android.gms:play-services-auth:18.1.0'

    implementation 'com.google.firebase:firebase-analytics:17.4.4'
    implementation 'com.google.firebase:firebase-auth:19.3.2'
    implementation ('com.google.firebase:firebase-firestore:21.5.0')
    implementation 'com.google.firebase:firebase-database:19.3.1'
    implementation 'com.google.firebase:firebase-storage:19.1.1'
    implementation 'com.google.firebase:firebase-functions:19.0.2'
    implementation 'com.google.firebase:firebase-messaging:20.2.4'

    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
    implementation 'com.android.billingclient:billing:2.0.3'


    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'de.hdodenhof:circleimageview:3.0.1'
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    implementation 'ja.burhanrashid52:photoeditor:1.0.0'

}
+--- com.google.firebase:firebase-firestore:21.5.0 -> 17.1.5
|    +--- com.google.android.gms:play-services-base:16.0.1 -> 16.1.0 (*)
|    +--- com.google.android.gms:play-services-basement:16.0.1 -> 16.2.0 (*)
|    +--- com.google.android.gms:play-services-tasks:16.0.1 (*)
|    +--- com.google.firebase:firebase-auth-interop:16.0.1 -> 17.0.0 (*)
|    +--- com.google.firebase:firebase-common:16.0.4 -> 17.1.0 (*)
|    +--- com.google.firebase:firebase-database-collection:16.0.1 -> 17.0.1
|    |    \--- com.google.android.gms:play-services-base:17.0.0 -> 16.1.0 (*)
|    +--- com.google.firebase:protolite-well-known-types:16.0.1 -> 17.1.0
|    |    \--- com.google.protobuf:protobuf-javalite:3.11.0
|    +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|    +--- com.squareup.okhttp:okhttp:2.7.5
|    |    \--- com.squareup.okio:okio:1.6.0 -> 1.15.0
|    +--- io.grpc:grpc-android:1.16.1
|    |    \--- io.grpc:grpc-core:[1.16.1] -> 1.16.1
|    |         +--- io.grpc:grpc-context:1.16.1
|    |         +--- com.google.code.gson:gson:2.7 -> 2.8.0
|    |         +--- com.google.errorprone:error_prone_annotations:2.2.0
|    |         +--- com.google.code.findbugs:jsr305:3.0.2
|    |         +--- org.codehaus.mojo:animal-sniffer-annotations:1.17
|    |         +--- com.google.guava:guava:26.0-android
|    |         |    +--- org.checkerframework:checker-compat-qual:2.5.2
|    |         |    \--- com.google.j2objc:j2objc-annotations:1.1
|    |         +--- io.opencensus:opencensus-api:0.12.3
|    |         |    \--- com.google.errorprone:error_prone_annotations:2.2.0
|    |         \--- io.opencensus:opencensus-contrib-grpc-metrics:0.12.3
|    |              +--- com.google.errorprone:error_prone_annotations:2.2.0
|    |              \--- io.opencensus:opencensus-api:0.12.3 (*)
|    +--- io.grpc:grpc-okhttp:1.16.1
|    |    +--- io.grpc:grpc-core:[1.16.1] -> 1.16.1 (*)
|    |    +--- com.squareup.okhttp:okhttp:2.5.0 -> 2.7.5 (*)
|    |    \--- com.squareup.okio:okio:1.13.0 -> 1.15.0
|    +--- io.grpc:grpc-protobuf-lite:1.16.1
|    |    +--- io.grpc:grpc-core:1.16.1 (*)
|    |    +--- com.google.protobuf:protobuf-lite:3.0.1
|    |    \--- com.google.guava:guava:26.0-android (*)
|    \--- io.grpc:grpc-stub:1.16.1
|         \--- io.grpc:grpc-core:1.16.1 (*)

但问题是我不能完全排除它。如果我这样做了,我的应用程序将编译,但一旦需要调用Firestore就会崩溃。只要我的应用程序启动。

我就是不明白。

共有1个答案

秦承安
2023-03-14

要找出谁在使用“jetified-protobuf-lite-3.0.1.jar”,请使用以下命令

gradle应用程序:依赖项

某些依赖项仍在使用旧版本的protobuf

 类似资料: