gpt4 book ai didi

android - 与依赖冲突 'com.google.inject:guice'

转载 作者:行者123 更新时间:2023-11-28 21:26:51 24 4
gpt4 key购买 nike

我收到以下错误:

错误:与依赖项“com.google.inject:guice”冲突。应用程序 (3.0) 和测试应用程序 (4.0) 的已解决版本不同。参见 http://g.co/androidstudio/app-test-app-conflict了解详情。

以下是我的 Gradle 文件:

 buildscript {
repositories {
maven { url 'https://maven.fabric.io/public'}

}

dependencies {
classpath 'io.fabric.tools:gradle:1.19.1'


}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'android-apt'

repositories {
maven { url 'https://maven.fabric.io/public' }
jcenter()
maven { url "https://jitpack.io" }
maven { url 'https://dl.bintray.com/intercom/intercom-maven' }


}



android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.imagecom"
minSdkVersion 16
targetSdkVersion 22
versionCode 16
versionName "3.8"
multiDexEnabled = true
testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"
useLibrary 'org.apache.http.legacy'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

signingConfigs{
release{
storeFile file(STORE_FILE)
storePassword STORE_PASSWORD
keyAlias STORE_PASSWORD
keyPassword STORE_PASSWORD
}

debug{
storeFile file(STORE_FILE_DEBUG)
storePassword STORE_PASSWORD_DEBUG
keyAlias STORE_PASSWORD_DEBUG
keyPassword STORE_PASSWORD_DEBUG
}
}



packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
//exclude 'META-INF/DEPENDENCIES'

}
dexOptions {
javaMaxHeapSize "7g"

}
lintOptions {
abortOnError false
checkReleaseBuilds false
}
buildTypes {
release {
minifyEnabled false
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
shrinkResources true
applicationIdSuffix ".debug"
}
sourceSets.debug.resources.srcDirs = ['src/debug/res']


}
productFlavors {
imagecom {
applicationId "com.imagecom.imagecom"
versionName = "7.7"
}
greencontrol {
applicationId "com.imagecom.greencontrol"
versionName = "1.0-greencontrol"
}
}


configurations.all {
resolutionStrategy {
force 'com.android.support:support-annotations:23.3.0'
}
}



}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile('org.apache.httpcomponents:httpmime:4.2.3') {
exclude group: 'org.apache.httpcomponents', module: 'httpcore'
}
compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
transitive = true;
}

compile project(':bluetoothspp')
compile('io.intercom.android:intercom-sdk:1.+@aar') {
transitive = true
}

compile 'com.android.support:design:23.3.0'
compile 'com.android.support:multidex:1.0.1'
androidTestCompile('com.android.support:multidex-instrumentation:1.0.1') {
exclude group: 'com.android.support', module: 'multidex'
}
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.android.support:palette-v7:23.3.0'
compile 'de.greenrobot:greendao:1.3.7'
compile 'com.mixpanel.android:mixpanel-android:4.5.3'
compile 'me.neavo:volley:2014.12.09'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'org.modelmapper:modelmapper:0.7.4'
compile 'com.theartofdev.edmodo:android-image-cropper:1.0.+'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'me.relex:circleindicator:1.0.0@aar'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
compile 'com.jakewharton:butterknife:6.1.0'
compile 'com.github.deano2390:MaterialShowcaseView:1.0.5'
compile 'org.roboguice:roboguice:2.0'
provided 'org.roboguice:roboblender:3.0.1'
compile 'joda-time:joda-time:2.8.2'
compile 'me.dm7.barcodescanner:zxing:1.8.3'
compile 'it.sephiroth.android.library.targettooltip:target-tooltip-library:1.3.2a'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.0'
compile 'io.reactivex:rxandroid:1.1.0'
compile 'com.github.hotchemi:permissionsdispatcher:2.0.8'
apt 'com.github.hotchemi:permissionsdispatcher-processor:2.0.8'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'
//Retrofit 2
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.0.1'
compile 'com.squareup.retrofit2:converter-gson:2.0.1'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
compile 'org.apache.commons:commons-lang3:3.4'
testCompile 'junit:junit:4.12'
testCompile ('org.robolectric:robolectric:3.0'){
exclude module: 'asm'
}

androidTestCompile 'org.testng:testng:6.9.6'
androidTestCompile 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'
def appModuleRootFolder = '.'
def srcDir = 'src'
def googleServicesJson = 'google-services.json'

task switchToDebug(type: Copy) {
description = 'Switches to DEBUG google-services.json'
from "src/debug"
include "google-services.json"
into "."
}

task switchToRelease(type: Copy) {
description = 'Switches to RELEASE google-services.json'
from "src/release"
include "google-services.json"
into "."
}

task switchToDebugGreencontrol(type: Copy) {
description = 'Switches to DEBUG google-services.json'
from "src/debug/greencontrol"
include "google-services.json"
into "."
}

task switchToReleaseGreencontrol(type: Copy) {
description = 'Switches to RELEASE google-services.json'
from "src/release/greencontrol"
include "google-services.json"
into "."
}



afterEvaluate {
processimagecomDebugGoogleServices.dependsOn switchToDebug
processimagecomReleaseGoogleServices.dependsOn switchToRelease
processGreencontrolDebugGoogleServices.dependsOn switchToDebugGreencontrol
processGreencontrolReleaseGoogleServices.dependsOn switchToReleaseGreencontrol
}

以下是bluetoothspp项目的gradle:

apply plugin: 'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion "22.0.0"

defaultConfig {
versionCode 7
versionName "3.3"
}

sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java']
res.srcDirs = ['src/main/res']
}
}
}

最佳答案

问题出在缓存中,当我按下清理并重建项目选项时,这些文件既没有被合并也没有被清除。

因为我已经将我的项目与 bitbucket 相关联,所以我使用 source-tree 存储了它。

以下链接将有助于了解如何存储: https://confluence.atlassian.com/sourcetreekb/stash-a-file-with-sourcetree-785332122.html

然后我清理并重建了我的项目,错误消失了。你们也应该这样做。

谢谢

关于android - 与依赖冲突 'com.google.inject:guice',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38166100/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com