我剛更新到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
相同的類,但我無法弄清楚哪些。
我希望有人可以幫忙。
嘗試清理並再次構建您的項目。看起來有些愚蠢的錯誤 – VicJordan 2014-12-05 14:35:11
似乎像清潔和構建不解決問題 – Luca 2014-12-05 14:41:54
已解決:問題是我的lib文件夾中的support-v4.jar – Luca 2014-12-05 15:23:33