错误属性已经定义

Error attribute has already been defined

我知道这个问题已经被问了很多..但我无法解决这个问题problem.I我是新手,帮帮我。 所以,我的 gradle 构建中有代码:


        dependencies {
        compile 'com.android.support:support-v4:18.0.0'
        compile 'com.google.android.gms:play-services:+'
        compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
        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.0.1\aapt.exe'' finished with non-zero exit value 1

谢谢!

请尝试按照以下步骤操作:

  1. 将.jar文件放入libs文件夹。
  2. 右键单击它并单击 'Add as Library'。
  3. 添加此行 compile files('libs/StartAppInApp-2.4.7.jar') 如果您有多个 .jar 文件,则添加此行:compile fileTree(dir: 'libs',包括:'*.jar').
  4. 做一个干净的构建。

这个方法对我有用。