我继承了我导入Android Studio的项目。
有3个模块(app和2个库)。在从Eclipse转换结束时,app和一个库都使用zbar.jar。
删除找到的所有其他重复项后,最后一个是zbar.jar。但我不知道哪种方法可以减少冗余。
在app和库中的build.gradle下面: 应用程序: 申请插件:' com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.google.zxing.client.android.customer"
minSdkVersion 15
targetSdkVersion 21
testApplicationId "com.google.zxing.client.android.customer.test"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
debug {
renderscriptDebuggable true
}
}
productFlavors {
}
sourceSets { main { res.srcDirs = ['src/main/res', 'src/main/res/values-21'] } }
dexOptions {
incremental true
javaMaxHeapSize "3g"
}
}
dependencies {
compile project(':tecladoLib')
compile project(':zBarScannerActivity')
compile files('libs/android-logging-log4j-1.0.3.jar')
compile files('libs/core.jar')
compile files('libs/HockeySDK.jar')
compile files('libs/ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar')
compile files('libs/log4j-1.2.17.jar')
compile files('libs/zbar.jar')
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.2.1'
compile 'com.android.support:appcompat-v7:21.0.3'
}
库:
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 15
targetSdkVersion 21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
}
}
dependencies {
compile files('libs/zbar.jar')
}