当我使用’com.Google.firebase:firebase-firestore:’超过15.0.0构建我的应用时,它会产生运行任务错误:
Program type already present: com.Google.protobuf.AbstractMessagelite$Builder$limitedinputStream
我已经搜索过这个问题并发现唯一的解决方案是使用15.0.0而不是17.0.4版本的FireStore是否还有其他方法可以在我的项目中使用最新版本?
成绩构建扫描链接:when using 15.0.0,when using 17.0.4
这是IDE找到的3个limitedinputStream.class
我看到其中一个是700行,所以如果你需要查看它们我可以将它们上传到任何网站.
具有FireSotre实现的后端的Gradle:
apply plugin: 'com.androID.library'androID { compileSdkVersion 27 defaultConfig { minSdkVersion 15 targetSdkVersion 27 versionCode 1 versionname "1.0" testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner"}buildTypes { release { MinifyEnabled false proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro' }}compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }}dependencIEs { implementation filetree(include: ['*.jar'], dir: 'libs')// modulesimplementation project(path: ':shared.resources')// uiimplementation "com.mikepenz:iconics-core:${versions.iconicslib}"implementation "com.mikepenz:iconics-vIEws:${versions.iconicslib}"implementation 'com.mikepenz:ionicons-typeface:2.0.1.4@aar'implementation 'com.unstoppable:submitbutton:1.1.3'implementation('com.lamudi.phonefIEld:phone-fIEld:0.1.3@aar') { transitive = true}implementation 'com.infIDeap.blockedittext:block-edittext:0.0.6'implementation 'com.firebaseui:firebase-ui-auth:4.0.0'// supportimplementation "com.androID.support:appcompat-v7:${versions.supportlib}"implementation 'com.androID.support.constraint:constraint-layout:1.1.2'// firebaseimplementation 'com.Google.firebase:firebase-core:16.0.1'implementation 'com.Google.firebase:firebase-auth:16.0.2'implementation 'com.Google.firebase:firebase-firestore:17.0.4'// social mediaimplementation 'com.facebook.androID:facebook-android-sdk:4.34.0'implementation 'com.twitter.sdk.androID:twitter-core:3.3.0@aar'// mixed versions avoIDanceimplementation "com.androID.support:support-media-compat:${versions.supportlib}"implementation "com.androID.support:support-v4:${versions.supportlib}"// timberimplementation "com.jakewharton.timber:timber:${versions.timberlib}"// testingtestImplementation 'junit:junit:4.12'androIDTestImplementation 'com.androID.support.test:runner:1.0.2'androIDTestImplementation 'com.androID.support.test.espresso:espresso-core:3.0.2'}apply plugin: 'com.Google.gms.Google-services'
顶级Gradle
// top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {ext{ versions = [ supportlib: "27.1.1", archlib: "1.1.1", butterKnifelib: '8.8.1', constraintLayuotlib: '1.1.2', junitlib: '4.12', testRunnerlib: '1.0.2', iconicslib: '3.0.4@aar', timberlib: '4.7.1' ]}repositorIEs { Google() jcenter()}dependencIEs { classpath 'com.androID.tools.build:gradle:3.1.3' classpath 'com.Google.gms:Google-services:4.0.2'}}allprojects { repositorIEs { Google() jcenter() maven { url 'https://jitpack.io' } maven{ url "https://dl.bintray.com/infIDeap2/Block-EditText" } }}task clean(type: Delete) { delete rootProject.buildDir}
App Gradle
apply plugin: 'com.androID.application'androID {compileSdkVersion 27defaultConfig { applicationID "com.tech.futureteric.goodmorning" // Todo support com.firebaseui:firebase-ui-auth on API 15 minSdkVersion 16 targetSdkVersion 27 versionCode 1 versionname "1.0-Alpha" multIDexEnabled true testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner"}buildTypes { release { MinifyEnabled false proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro' } buildTypes.each { it.buildConfigFIEld "String", "UNSPLASH_API_KEY", "\"$System.env.UNSPLASH_API_KEY\"" }}compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8}}dependencIEs {implementation filetree(include: ['*.jar'], dir: 'libs')// modulesimplementation project(path: ':lockscreen.ui')implementation project(path: ':intro.ui')implementation project(path: ':shared.resources')implementation project(path: ':backend')implementation project(path: ':find.frIEnds')// lockScreen ui librarIEsimplementation 'com.github.HITGIF:TextFIEldBoxes:1.4.4'// about ui librarIEsimplementation "com.mikepenz:aboutlibrarIEs:6.1.0"implementation 'com.github.jrvansuita:MaterialAbout:0.2.3'// timberimplementation "com.jakewharton.timber:timber:${versions.timberlib}"// lifecycle and persistenceimplementation "androID.arch.lifecycle:extensions:${versions.archlib}"implementation "androID.arch.lifecycle:viewmodel:${versions.archlib}"implementation "androID.arch.persistence.room:runtime:${versions.archlib}"annotationProcessor "androID.arch.persistence.room:compiler:${versions.archlib}"// injectionimplementation 'javax.inject:javax.inject:1@jar'// butterKnifeimplementation "com.jakewharton:butterknife:${versions.butterKnifelib}"annotationProcessor "com.jakewharton:butterknife-compiler:${versions.butterKnifelib}"// retrofitimplementation 'com.squareup.retrofit2:retrofit:2.4.0'implementation 'com.squareup.retrofit2:converter-gson:2.3.0'// support librarIEsimplementation "com.androID.support:appcompat-v7:${versions.supportlib}"implementation "com.androID.support:design:${versions.supportlib}"implementation "com.androID.support:support-annotations:${versions.supportlib}"implementation "com.androID.support:support-v4:${versions.supportlib}"implementation "com.androID.support:recyclervIEw-v7:${versions.supportlib}"// mixed versions avoIDanceimplementation "com.androID.support:exifinterface:${versions.supportlib}"// constraint layoutimplementation "com.androID.support.constraint:constraint-layout:${versions.constraintLayuotlib}"implementation 'cn.hugeterry.coordinatortablayout:coordinatortablayout:1.2.2'// multi-deximplementation 'com.androID.support:multIDex:1.0.3'// picassoimplementation 'com.squareup.picasso:picasso:2.71828'// testingtestImplementation 'junit:junit:4.12'androIDTestImplementation 'com.androID.support.test:runner:1.0.2'androIDTestImplementation 'com.androID.support.test.espresso:espresso-core:3.0.2'}
find.frIEnds Gradle
apply plugin: 'com.androID.library'androID {compileSdkVersion 27defaultConfig { minSdkVersion 15 targetSdkVersion 27 versionCode 1 versionname "1.0" testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner"}buildTypes { release { MinifyEnabled false proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro' }}compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8}}dependencIEs {implementation filetree(include: ['*.jar'], dir: 'libs')// modulesimplementation project(path: ':shared.resources')implementation project(path: ':backend')// uiimplementation 'com.github.florent37:materialtextfIEld:1.0.7'// supportimplementation 'com.androID.support:appcompat-v7:27.1.1'implementation 'com.androID.support.constraint:constraint-layout:1.1.2'testImplementation 'junit:junit:4.12'androIDTestImplementation 'com.androID.support.test:runner:1.0.2'androIDTestImplementation 'com.androID.support.test.espresso:espresso-core:3.0.2'implementation 'com.androID.support:design:27.1.1'}
intro.ui Gradle
apply plugin: 'com.androID.library'androID {compileSdkVersion 27defaultConfig { minSdkVersion 15 targetSdkVersion 27 versionCode 1 versionname "1.0" testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner"}buildTypes { release { MinifyEnabled false proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro' }}compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8}}dependencIEs {implementation filetree(include: ['*.jar'], dir: 'libs')// modulesimplementation project(path: ':backend')implementation project(path: ':shared.resources')// intro uiimplementation 'com.nightonke:boommenu:2.1.1'// supportimplementation "com.androID.support:appcompat-v7:${versions.supportlib}"implementation "com.androID.support:support-v4:${versions.supportlib}"// testingimplementation 'com.androID.support.constraint:constraint-layout:1.1.2'testImplementation 'junit:junit:4.12'androIDTestImplementation 'com.androID.support.test:runner:1.0.2'androIDTestImplementation 'com.androID.support.test.espresso:espresso-core:3.0.2'}
lobkscreen.ui Gradle
apply plugin: 'com.androID.library'androID {compileSdkVersion 27defaultConfig { minSdkVersion 15 targetSdkVersion 27 versionCode 1 versionname "1.0" testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner"}buildTypes { release { MinifyEnabled false proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro' }}compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8}}dependencIEs {implementation filetree(include: ['*.jar'], dir: 'libs')// butterKnife is not used with this projects as issue #1130 with librarIEs// @link (https://github.com/JakeWharton/butterknife/issues/1130)// Todo (1) is there is any resource to learn from it how to comment and add clickable text?// supportimplementation "com.androID.support:appcompat-v7:${versions.supportlib}"implementation 'com.androID.support:recyclervIEw-v7:27.1.1'// constraintimplementation "com.androID.support.constraint:constraint-layout:${versions.constraintLayuotlib}"// animationsimplementation 'com.jaredrummler:animated-svg-vIEw:1.0.5'// testingtestImplementation "junit:junit:${versions.junitlib}"androIDTestImplementation "com.androID.support.test:runner:${versions.testRunnerlib}"androIDTestImplementation 'com.androID.support.test.espresso:espresso-core:3.0.2'}
shared.resources Gradle
apply plugin: 'com.androID.library'androID {compileSdkVersion 27defaultConfig { minSdkVersion 15 targetSdkVersion 27 versionCode 1 versionname "1.0" testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner"}buildTypes { release { MinifyEnabled false proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro' }}compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8}}dependencIEs {implementation filetree(include: ['*.jar'], dir: 'libs')// iconsimplementation "com.mikepenz:iconics-core:3.0.4@aar"implementation 'com.mikepenz:ionicons-typeface:2.0.1.4@aar'// dialog uiimplementation 'com.afollestad.material-dialogs:core:0.9.6.0'// supportimplementation "com.androID.support:appcompat-v7:${versions.supportlib}"// mixed versions avoIDanceimplementation 'com.androID.support:recyclervIEw-v7:27.1.1'// timberimplementation "com.jakewharton.timber:timber:${versions.timberlib}"// testingtestImplementation 'junit:junit:4.12'androIDTestImplementation 'com.androID.support.test:runner:1.0.2'androIDTestImplementation 'com.androID.support.test.espresso:espresso-core:3.0.2'}
解决方法:
您需要通过排除重复项来防止重复的类:
implementation ("com.Google.firebase:firebase-firestore:17.0.4") { exclude group: "com.Google.protobuf"}
可能是,您必须排除com.Google.guava,而不是……
检查./gradlew:app:dependencIEs,然后添加所需的exclude语句.
总结以上是内存溢出为你收集整理的android – 使用晚于15.0.0版本的FireStore导致错误全部内容,希望文章能够帮你解决android – 使用晚于15.0.0版本的FireStore导致错误所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)