在项目

时间:2016-11-14 06:21:17

标签: android eclipse android-studio android-gradle android-build

我在项目中使用模块时遇到错误 自定义模块build.gradle(模块:comibdtddatepickerlib)具有依赖编译“com.android.support:support-v4:21.0.+”,也在主项目buid.gradle编译“com.android.support:support-v4:21.0 。+“

但我排除了当我添加模块的依赖性但仍然给出错误

  • 错误:(253)属性“switchMinWidth”已定义
  • 错误:(253)属性“switchPadding”已经定义
  • 错误:(254)属性“switchStyle”已定义
  • d:\ AAA \ Doctors1 \医生\建立\中间体\ RES \合并\调试\值\ values.xml

当我在android studio中导入eclipse项目时

我有以下gradle文件

  • build.gradle(项目:mainproject)
  • build.gradle(Module:comibdtddatepickerlib)
  • build.gradle(Module:datetimepickerlibrary)
  • build.gradle(Module:mainproject)
  • build.gradle(Module:libraryviewpagerindicator)
  • build.gradle(Module:pagerSlidingTabStrip)
  • build.gradle(Module:stickeyHeaderListView)
  • build.gradle(Module:twoWayHorizo​​ntalScrollView)

文件编码是 build.gradle(模块:comibdtddatepickerlib)

apply plugin: 'com.android.library'

android {
    compileSdkVersion 21
    buildToolsVersion "23.0.3"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 21
    }

    aaptOptions
            {
                cruncherEnabled = false
            }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile "com.android.support:appcompat-v7:21.0.+"
    compile "com.android.support:support-v4:21.0.+"
}

文件编码为 build.gradle(Module:datetimepickerlibrary)

apply plugin: 'com.android.library'

android {
    compileSdkVersion 19
    buildToolsVersion "23.0.3"

    defaultConfig {
    }

    aaptOptions
    {
        cruncherEnabled = false
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'),   'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:support-v4:19.1.0'
    compile files('libs/nineoldandroids.jar')
}

文件编码为 build.gradle(模块:mainproject)(主项目)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.abc.xyz"
        minSdkVersion 8
        targetSdkVersion 21
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }
    }

    aaptOptions
    {
       cruncherEnabled = false
    }

    buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            }
    }
}

repositories {
    jcenter()
}

dependencies {
    compile project(':stickeyHeaderListView')
    compile project(':twoWayHorizontalScrollView')
    compile(project(':libraryviewpagerindicator')){
        exclude group:'com.android.support', module: 'support-v4'
    }
    compile(project(':pagerSlidingTabStrip')){
        exclude group:'com.android.support', module: 'support-v4'
    }
    compile(project(':datetimepickerlibrary')){
        exclude group:'com.android.support', module: 'support-v4'
    }
    compile(project(':comibdtddatepickerlib')){
        exclude group:'com.android.support', module: 'support-v4'
    }
    compile "com.android.support:appcompat-v7:21.0.+"
    compile "com.android.support:support-v4:21.0.+"
    compile files('libs/commons-io-2.4.jar')
    compile files('libs/glide-3.4.0.jar')
    compile files('libs/itextpdf-5.3.5.jar')
    compile files('libs/ksoap2-android-assembly-2.4-jar-with-dependencies.jar')
    compile files('libs/library-1.2.1.jar')
    compile files('libs/mpandroidchartlibrary-2-2-4.jar')
    compile files('libs/PdfViewer.jar')
    compile files('libs/picasso-2.3.4.jar')
    compile files('libs/sc-light-jdk15on-1.47.0.2.jar')
    compile files('libs/scpkix-jdk15on-1.47.0.2.jar')
    compile files('libs/scprov-jdk15on-1.47.0.2.jar')
}

0 个答案:

没有答案