2016-08-25 94 views
0

我知道這個問題已被問了很多..但我無法解決這個問題。我是一個新手,幫助我。 因此,有代碼的gradle我編譯:錯誤屬性已被定義

 

     dependencies { 
     compile 'com.android.support:support-v4:18.0.0' 
     compile 'com.google.android.gms:play-services:+' 
     compile 'com.actionbarsherlock:actionbarsherlock:[email protected]' 
     compile 'com.android.support:support-v4:18.0.0' 
     compile files('libs/StartAppInApp-2.4.7.jar') 
    } 

,這是我的錯誤:

 

    Error:(160) Attribute "background" already defined with incompatible format. 
    Error:(14) Original attribute defined here. 
    Error:(197) Attribute "navigationMode" already defined with incompatible format. 
    Error:(160) Original attribute defined here. 
    Error:(197) Attribute "displayOptions" already defined with incompatible format. 
    Error:(160) Original attribute defined here. 
    Error:(212) Attribute "windowMinWidthMajor" already defined with incompatible format. 
    Error:(206) Original attribute defined here. 
    Error:(212) Attribute "windowMinWidthMinor" already defined with incompatible format. 
    Error:(206) Original attribute defined here. 
    Error:(212) Attribute "actionBarSize" already defined with incompatible format. 
    Error:(206) Original attribute defined here. 
    Error:Execution failed for task ':app:processDebugResources'. 
    > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Truc\AppData\Local\Android\Sdk\build-tools\24.0.1\aapt.exe'' finished with non-zero exit value 1 

謝謝!

回答

0

請嘗試以下步驟:

  1. 認沽.jar文件到libs文件夾。
  2. 右鍵單擊它並單擊「添加爲庫」。
  3. 添加此行編譯文件('libs/StartAppInApp-2.4.7.jar')或此行如果您有多個.jar文件:compile fileTree(dir:'libs',include:'* .jar')
  4. 做一個乾淨的構建。

此方法適用於我。

+0

謝謝你,我試過這樣做,但它不適合我。我認爲這個錯誤出現是因爲actionbarsherlock,但我不知道如何解決它。 – htantruc

+0

您是否必須使用actionbarsherlock?您可以使用AppCompat獲取更新的操作欄。看看:http://android-developers.blogspot.com/2014/10/appcompat-v21-material-design-for-pre.html – RamithDR