2016-08-25 95 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