如何应对Android Studio中的重复罐子? [英] How to deal with the repeated jar in Android Studio?
问题描述
如图所示,XXX完成了非零退出值2,也有人说是重复的罐子引起它。但是我没有找到重复罐子yet.So,我该怎么处理呢?
http://i3.tietuku.com/10ec1b3775cbb850.png
应用程序 - 的build.gradle:
应用插件:'com.android.application安卓{
compileSdkVersion 22
buildToolsVersion22.0.1 defaultConfig {
的applicationIDcom.myatejx.quicknote
16的minSdkVersion
targetSdkVersion 21
版本code 4
的versionName1.2.0
}
buildTypes {
发布 {
minifyEnabled假
proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard-rules.pro
}
}
}tasks.withType(JavaCompile){
options.encoding =UTF-8
}依赖{
编制项目(':SwipeMenuListView')
编制项目(':Ldrawer')
编制项目(:小吃吧')
}
SwipeMenuListView - 图书馆 - 的build.gradle:
应用插件:'com.android.library安卓{
compileSdkVersion 22
buildToolsVersion22.0.1 defaultConfig {
16的minSdkVersion
targetSdkVersion 22
版本code 1
的versionName1.0
}
buildTypes {
sourceSets {
主要{
manifest.srcFile'的AndroidManifest.xml
java.srcDirs = ['src'中]
resources.srcDirs = ['src'中]
aidl.srcDirs = ['src'中]
renderscript.srcDirs = ['src'中]
res.srcDirs = ['水库']
}
}
发布 {
minifyEnabled假
proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard-rules.pro
}
}
}依赖{
编译文件(库/ Android的支持 - v4.jar')
}
小吃吧 - 图书馆 - 的build.gradle:
应用插件:'com.android.library安卓{
compileSdkVersion 22
buildToolsVersion22.0.1 defaultConfig {
16的minSdkVersion
targetSdkVersion 22
版本code 1
的versionName1.0
}
buildTypes {
发布 {
minifyEnabled假
proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard-rules.pro
}
}
}tasks.withType(JavaCompile){
options.encoding =UTF-8
}依赖{
编译com.android.support:recyclerview-v7:22.0.0
编译com.android.support:support-annotations:22.0.0
}Maven的push.gradle:从申请
Ldrawer - 图书馆 - 的build.gradle:
应用插件:'com.android.library安卓{
compileSdkVersion 22
buildToolsVersion22.0.1 defaultConfig {
16的minSdkVersion
targetSdkVersion 22
版本code 1
的versionName1.0
}
buildTypes {
发布 {
minifyEnabled假
proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard-rules.pro
}
}
}tasks.withType(JavaCompile){
options.encoding =UTF-8
}依赖{
编译com.android.support:support-v4:22.0.0
}//来自适用:https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle
试试这个,
在您的code
defaultConfig {
的applicationIDcom.myatejx.quicknote
16的minSdkVersion
targetSdkVersion 21
版本code 4
的versionName1.2.0
multiDexEnabled真
}
如果multidex是enabled.The gradle这个会忽略重复的DEX文件
As shown in the figure,"xxx finished with non-zero exit value 2",some people say that is the repeated jars caused it.But I did not find the repeat jars yet.So,how can I deal with it?
http://i3.tietuku.com/10ec1b3775cbb850.png
App - build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.myatejx.quicknote"
minSdkVersion 16
targetSdkVersion 21
versionCode 4
versionName "1.2.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
dependencies {
compile project(':SwipeMenuListView')
compile project(':Ldrawer')
compile project(':Snackbar')
}
SwipeMenuListView - Library - build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
}
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile files('libs/android-support-v4.jar')
}
Snackbar - Library - build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
dependencies {
compile 'com.android.support:recyclerview-v7:22.0.0'
compile 'com.android.support:support-annotations:22.0.0'
}
apply from: 'maven-push.gradle'
Ldrawer - Library - build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
dependencies {
compile 'com.android.support:support-v4:22.0.0'
}
//apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'
Try this, In your code
defaultConfig {
applicationId "com.myatejx.quicknote"
minSdkVersion 16
targetSdkVersion 21
versionCode 4
versionName "1.2.0"
multiDexEnabled true
}
If multidex is enabled.The gradle will neglect the duplicate dex files
这篇关于如何应对Android Studio中的重复罐子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!