2014-12-13 92 views
2

我仍然在我的Macbook Air上使用Android Studio 0.8.9。在我的iMac上,我安裝了Android Studio 1.0。org.apache.commons.collections.ArrayStack已被添加到輸出。請刪除重複的副本

由於1.0只支持'com.android.tools.build:gradle:1.0.0',我不得不改變我在這裏提到的build.gradles 。 Gradle DSL method not found: 'runProguard'

0.8.9使用 'com.android.tools.build:gradle:0.12.2'

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 20 
    buildToolsVersion "20.0.0" 

    defaultConfig { 
     applicationId "com.example...." 
     minSdkVersion 19 
     targetSdkVersion 20 
     versionCode 1 
     versionName "0.87" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    packagingOptions { 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
    } 
    dexOptions { 
     preDexLibraries = false 
    } } 

repositories { 
    mavenCentral() 
    flatDir { 
    dirs 'libs' 
    } } 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    wearApp project(':wear') 
    compile 'com.android.support:support-v4:20.0.+' 
    compile 'com.google.android.gms:play-services-wearable:+' 
    compile 'com.spotify.sdk:spotifysdk:[email protected]' 
    compile('se.michaelthelin.spotify:spotify-web-api-java:1.4.20') 
} 

隨着0.8.9測試版在我的MacBook Air我的應用程序建立的罰款。在我的iMac上我收到這個錯誤。

org.apache.commons.collections.ArrayStack已被添加到輸出。請刪除重複的副本。

UPDATE 的問題似乎是公共的集合被添加到外部庫和公地BeanUtils的其中還包括一個公共的集合。

編譯( 'se.michaelthelin.spotify:Spotify的幅材-API-java的:1.4.20'){ 排除組: 「公地BeanUtils的」,模塊: 「公地BeanUtils的」 }

如果我排除commons-beanutils,構建過程很好,但應用程序崩潰,因爲它需要commons-beanutils。同樣如果我排除公共收藏。

此外,我試圖手動從公地BeanUtils的罐子刪除的文件夾常見的集合,但是這也沒有工作..

回答

0

嘗試:

project > clean 

project > rebuild 

,並再次運行

+0

已經嘗試過這一點,項目改造工程,但它拋出相同運行錯誤。 – Alex 2014-12-13 12:29:53

+0

嘗試刪除所有生成的目錄(build,bin等),並重新清理並重新生成。 如果這不起作用,你必須搜索哪些圖書館有這個類,並排除一個。 – Mou 2014-12-13 12:41:51

+0

感謝您的幫助,編譯'net.sf.json-lib:json-lib:2.4:jdk15'導致了這個問題。如果我刪除這個(並刪除我的Java文件)它運行沒有錯誤。 json-lib也有org.apache.commons.collections,請參閱http://mvnrepository.com/artifact/net.sf.json-lib/json-lib/2.4。那麼我如何將它排除在build.gradle? – Alex 2014-12-13 13:28:17

1

最後它的工作。

這個不包含commons-collections,所以一切工作正常。 編譯「公地的BeanUtils:公地的BeanUtils:20030211.134440」

不明白爲什麼這是沒有必要的測試版0.8.9

compile('se.michaelthelin.spotify:spotify-web-api-java:1.4.20') { 
     exclude group: "commons-beanutils", module: "commons-beanutils" 

    } 
    compile 'commons-beanutils:commons-beanutils:20030211.134440' 
相關問題