Android 程序类型已存在com google protobuf描述符Protos

Android 程序类型已存在com google protobuf描述符Protos,android,gradle,runtime-error,Android,Gradle,Runtime Error,几个小时后,我决定分享我的问题 //根构建.gradle buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' classpath 'com.google.gms:google-services:4.1.0' classpath "io.realm:realm-gra

几个小时后,我决定分享我的问题

//根构建.gradle

buildscript {
   repositories {
    google()
    jcenter()
   }
   dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
    classpath 'com.google.gms:google-services:4.1.0'
    classpath "io.realm:realm-gradle-plugin:5.4.1"
   }
}
   allprojects {
    repositories {
    google()
    jcenter()
    maven {url 'http://jitpack.io'}
  }
}
task clean(type: Delete) {
delete rootProject.buildDir
}
buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'

repositories {
    google()
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
    maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
    maven { url 'https://dl.bintray.com/siclo/SicloAndroidOSS' }
}

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"

    dexOptions {
        javaMaxHeapSize "4g"
        jumboMode true
        preDexLibraries = false
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        multiDexEnabled true
        applicationId "my.chart.card.app"
        minSdkVersion 17
        targetSdkVersion 28
        versionCode 63
        versionName "2.1.7"
        vectorDrawables.useSupportLibrary = true
    }

  // SOME GRADLE CODE BUT I CUT IT (build release ...)

ext.ANDROID_SUPPORT_LIBRARY_VERSION = "28.0.0"
ext.GOOGLE_PLAY_VERSION = "16.0.0"
ext.FIREBASE_VERSION = "16.0.4"


dependencies {
    configurations {
        all*.exclude group: 'com.android.support', module: 'support-v13'
        all*.exclude group: 'com.google.firebase', module: 'firebase-crash'
        all*.exclude group: 'com.google.protobuf', module: 'protobuf-lite'
    }
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:' + ANDROID_SUPPORT_LIBRARY_VERSION
    implementation 'com.android.support:support-v4:' + ANDROID_SUPPORT_LIBRARY_VERSION
    implementation 'com.android.support:exifinterface:' + ANDROID_SUPPORT_LIBRARY_VERSION
    implementation 'com.android.support:percent:' + ANDROID_SUPPORT_LIBRARY_VERSION
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'

    implementation 'com.android.support:design:' + ANDROID_SUPPORT_LIBRARY_VERSION
    implementation 'com.android.support:cardview-v7:' + ANDROID_SUPPORT_LIBRARY_VERSION
    implementation 'com.google.android.gms:play-services-location:' + GOOGLE_PLAY_VERSION
    implementation 'com.google.android.gms:play-services-places:' + GOOGLE_PLAY_VERSION

    implementation 'com.google.maps.android:android-maps-utils:0.5'

    implementation 'com.google.firebase:firebase-core:' + FIREBASE_VERSION
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.google.firebase:firebase-database:16.0.3'
    implementation 'com.google.firebase:firebase-auth:' + FIREBASE_VERSION
    implementation 'com.google.firebase:firebase-storage:16.0.3'
    implementation ('com.firebaseui:firebase-ui-firestore:4.2.0') {
        exclude group: "com.google.protobuf", module: "protobuf-lite"
    }

    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'

    implementation 'com.simmorsal.library:concealer_nested_scroll_view:2.0.0'
    implementation 'jp.wasabeef:recyclerview-animators:2.2.7'
    implementation 'com.gmail.samehadar:iosdialog:1.0'

    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'

    implementation 'com.google.code.gson:gson:2.8.5'

    implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }

    implementation 'io.card:android-sdk:5.5.1'

    implementation 'com.google.guava:guava:23.6-android'

    implementation 'com.cleveroad:slidingtutorial:1.0.8'

    implementation 'com.github.takusemba:spotlight:1.1.3'
    implementation 'uk.co.chrisjenx:calligraphy:2.2.0'
    implementation 'com.aurelhubert:ahbottomnavigation:2.1.0'

    implementation 'com.irozon.sneaker:sneaker:1.0.3'

    implementation('com.lamudi.phonefield:phone-field:0.1.3@aar') {
        transitive = true
    }

    implementation 'uk.co.deanwild:flowtextview:2.0.2@aar'
    implementation 'de.greenrobot:eventbus:2.4.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.facebook.android:facebook-login:4.37.0'

    implementation 'com.github.bumptech.glide:glide:4.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'

    implementation 'com.algolia:algoliasearch-android:3.+'
    implementation 'com.github.takusemba:multisnaprecyclerview:1.3.3'
    implementation 'com.github.livefront:bridge:v1.1.2'
    implementation 'de.hdodenhof:circleimageview:2.2.0'

    implementation 'com.commonsware.cwac:provider:0.5.0'

    implementation 'io.intercom.android:intercom-sdk-base:5.+'
    implementation('io.intercom.android:intercom-sdk-fcm:5.+') {
        exclude group: 'io.intercom.android', module: 'intercom-sdk-base'
    }

    implementation 'com.siclo.ezphotopick:library:1.0.8'
}

apply plugin: 'com.google.gms.google-services'
//应用程序build.gradle

buildscript {
   repositories {
    google()
    jcenter()
   }
   dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
    classpath 'com.google.gms:google-services:4.1.0'
    classpath "io.realm:realm-gradle-plugin:5.4.1"
   }
}
   allprojects {
    repositories {
    google()
    jcenter()
    maven {url 'http://jitpack.io'}
  }
}
task clean(type: Delete) {
delete rootProject.buildDir
}
buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'

repositories {
    google()
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
    maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
    maven { url 'https://dl.bintray.com/siclo/SicloAndroidOSS' }
}

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"

    dexOptions {
        javaMaxHeapSize "4g"
        jumboMode true
        preDexLibraries = false
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        multiDexEnabled true
        applicationId "my.chart.card.app"
        minSdkVersion 17
        targetSdkVersion 28
        versionCode 63
        versionName "2.1.7"
        vectorDrawables.useSupportLibrary = true
    }

  // SOME GRADLE CODE BUT I CUT IT (build release ...)

ext.ANDROID_SUPPORT_LIBRARY_VERSION = "28.0.0"
ext.GOOGLE_PLAY_VERSION = "16.0.0"
ext.FIREBASE_VERSION = "16.0.4"


dependencies {
    configurations {
        all*.exclude group: 'com.android.support', module: 'support-v13'
        all*.exclude group: 'com.google.firebase', module: 'firebase-crash'
        all*.exclude group: 'com.google.protobuf', module: 'protobuf-lite'
    }
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:' + ANDROID_SUPPORT_LIBRARY_VERSION
    implementation 'com.android.support:support-v4:' + ANDROID_SUPPORT_LIBRARY_VERSION
    implementation 'com.android.support:exifinterface:' + ANDROID_SUPPORT_LIBRARY_VERSION
    implementation 'com.android.support:percent:' + ANDROID_SUPPORT_LIBRARY_VERSION
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'

    implementation 'com.android.support:design:' + ANDROID_SUPPORT_LIBRARY_VERSION
    implementation 'com.android.support:cardview-v7:' + ANDROID_SUPPORT_LIBRARY_VERSION
    implementation 'com.google.android.gms:play-services-location:' + GOOGLE_PLAY_VERSION
    implementation 'com.google.android.gms:play-services-places:' + GOOGLE_PLAY_VERSION

    implementation 'com.google.maps.android:android-maps-utils:0.5'

    implementation 'com.google.firebase:firebase-core:' + FIREBASE_VERSION
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.google.firebase:firebase-database:16.0.3'
    implementation 'com.google.firebase:firebase-auth:' + FIREBASE_VERSION
    implementation 'com.google.firebase:firebase-storage:16.0.3'
    implementation ('com.firebaseui:firebase-ui-firestore:4.2.0') {
        exclude group: "com.google.protobuf", module: "protobuf-lite"
    }

    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'

    implementation 'com.simmorsal.library:concealer_nested_scroll_view:2.0.0'
    implementation 'jp.wasabeef:recyclerview-animators:2.2.7'
    implementation 'com.gmail.samehadar:iosdialog:1.0'

    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'

    implementation 'com.google.code.gson:gson:2.8.5'

    implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }

    implementation 'io.card:android-sdk:5.5.1'

    implementation 'com.google.guava:guava:23.6-android'

    implementation 'com.cleveroad:slidingtutorial:1.0.8'

    implementation 'com.github.takusemba:spotlight:1.1.3'
    implementation 'uk.co.chrisjenx:calligraphy:2.2.0'
    implementation 'com.aurelhubert:ahbottomnavigation:2.1.0'

    implementation 'com.irozon.sneaker:sneaker:1.0.3'

    implementation('com.lamudi.phonefield:phone-field:0.1.3@aar') {
        transitive = true
    }

    implementation 'uk.co.deanwild:flowtextview:2.0.2@aar'
    implementation 'de.greenrobot:eventbus:2.4.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.facebook.android:facebook-login:4.37.0'

    implementation 'com.github.bumptech.glide:glide:4.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'

    implementation 'com.algolia:algoliasearch-android:3.+'
    implementation 'com.github.takusemba:multisnaprecyclerview:1.3.3'
    implementation 'com.github.livefront:bridge:v1.1.2'
    implementation 'de.hdodenhof:circleimageview:2.2.0'

    implementation 'com.commonsware.cwac:provider:0.5.0'

    implementation 'io.intercom.android:intercom-sdk-base:5.+'
    implementation('io.intercom.android:intercom-sdk-fcm:5.+') {
        exclude group: 'io.intercom.android', module: 'intercom-sdk-base'
    }

    implementation 'com.siclo.ezphotopick:library:1.0.8'
}

apply plugin: 'com.google.gms.google-services'
由于我更新到3.2.1,google play services更新到4.1.0,并添加了Firebase/Firestore库,因此出现以下错误:

Error: Program type already present: com.google.protobuf.DescriptorProtos$DescriptorProto$Builder
我尝试了/gradlew:app:dependencies>/dependencies.txt并像这样排除protobuff排除组:“com.google.protobuf”,模块:“protobuf lite”,但似乎是错误的,仍然是错误的

gradle-4.6-all.zip 安卓工作室3.2


如果有人遇到同样的问题并有一些解决方案,那就太好了。

重复的问题就在这个库中 实现('com.lamudi.phonefield:phone-field:0.1。3@aar)


但是我不知道为什么/gradlew:app:dependencies没有显示证据。

问题来自你的
com.lamudi.phonefield
依赖关系。有一个谷歌代码依赖项导致了崩溃

尝试分叉并更新到
实现'com.googlecode.libphonenumber:libphonenumber:8.10.3'


无论如何都不会维护lib。否则,存在此分叉:
https://github.com/ialokim/android-phone-field

将firestore降级到v12.0.0将删除此冲突

添加firestore时出现的完全相同的问题。。。Foud解决方案??