2014-12-05 44 views
0

我剛更新到Android Studio 1.0 RC 4,它給了我一些奇怪的錯誤,但我不明白爲什麼。類android.support.v4.net。*已經添加到輸出

的錯誤是:

Error:Class android.support.v4.net.ConnectivityManagerCompatGingerbread has already been added to output. Please remove duplicate copies. 
Error:Class android.support.v4.net.TrafficStatsCompat has already been added to output. Please remove duplicate copies. 

和我的build.gradle(編譯部分)爲:

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    //compile 'com.android.support:support-v4:19.+' 
    compile 'com.fasterxml.jackson.core:jackson-core:2.3.2' 
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.3.2' 
    compile 'com.fasterxml.jackson.core:jackson-databind:2.3.2' 
    compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE' 
    compile 'org.springframework.android:spring-android-core:1.0.1.RELEASE' 
    //compile 'com.github.mrengineer13:snackbar:0.4.0' 
    //compile 'com.android.support:support-v4:21.0.0' 
    compile 'com.squareup.picasso:picasso:2.4.0' 
    compile 'com.android.support:appcompat-v7:21.0.+' 
    //compile 'com.android.support:cardview-v7:21.0.+' 
    //compile 'com.android.support:recyclerview-v7:21.0.+' 
    compile 'com.pnikosis:materialish-progress:1.0' 
} 

我在其他一些問題看,它依賴於共享兩個依賴從v4相同的類,但我無法弄清楚哪些。

我希望有人可以幫忙。

+0

嘗試清理並再次構建您的項目。看起來有些愚蠢的錯誤 – VicJordan 2014-12-05 14:35:11

+0

似乎像清潔和構建不解決問題 – Luca 2014-12-05 14:41:54

+0

已解決:問題是我的lib文件夾中的support-v4.jar – Luca 2014-12-05 15:23:33

回答

0

首先,嘗試更新您使用的jacksons版本,從2.3.22.4.0。 這是你的新代碼:

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
//compile 'com.android.support:support-v4:19.+' 
compile 'com.fasterxml.jackson.core:jackson-core:2.4.0' 
compile 'com.fasterxml.jackson.core:jackson-annotations:2.4.0' 
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.0' 
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE' 
compile 'org.springframework.android:spring-android-core:1.0.1.RELEASE' 
//compile 'com.github.mrengineer13:snackbar:0.4.0' 
//compile 'com.android.support:support-v4:21.0.0' 
compile 'com.squareup.picasso:picasso:2.4.0' 
compile 'com.android.support:appcompat-v7:21.0.+' 
//compile 'com.android.support:cardview-v7:21.0.+' 
//compile 'com.android.support:recyclerview-v7:21.0.+' 
compile 'com.pnikosis:materialish-progress:1.0' 

}

它編譯我。

+0

從2.3.2更改爲2.4.0似乎沒有解決任何問題... – Luca 2014-12-05 15:01:52

+0

因此嘗試評論com.fasterxml.jackson.core:jackson-databind:2.4.0 – 2014-12-06 10:21:53

相關問題