重复条目Android Studio中 [英] Duplicate Entry in Android Studio
问题描述
我能够成功构建项目Android Studio中,但是当我试图运行应用程序得到错误像这样的重复的条目:安卓/支持/ V4 /打印/ PrintHelper $ 1.class,我已搜查很多网站,并试图很多建议,但失败。请帮助me..below的是我的codeI为奋斗2天的时间这一点。
应用插件:'com.android.application
依赖{
编译文件树(导演:'库',包括:的* .jar)
编制项目(':appcompat_v7')
编制项目(:谷歌播放services_lib')
编制项目(':Cognalys')
// noinspection GradleDynamicVersion
编译com.android.support:recyclerview-v7:22.2.+
}
安卓{
compileSdkVersion 22
buildToolsVersion23.0.0 RC3
sourceSets {
主要{
manifest.srcFile'的AndroidManifest.xml
java.srcDirs = ['src'中]
resources.srcDirs = ['src'中]
aidl.srcDirs = ['src'中]
renderscript.srcDirs = ['src'中]
res.srcDirs = ['水库']
assets.srcDirs = ['资产']
}
//移动测试,测试/ JAVA,测试/ RES等...
instrumentTest.setRoot(测试)
debug.setRoot(集结类型/调试)
release.setRoot(集结类型/释放)
}
defaultConfig {
//启用multidex支持。
multiDexEnabled真
}
buildTypes {
发布 {
minifyEnabled假
proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard-rules.pro
}
}
}
我遇到了同样的错误,我解决这个问题,但我只给ü认为我的情况;
我bulid.gradle:
{相关性
编译文件树(包括:['的* .jar'],DIR:库)
编译('com.android.support:appcompat-v7:22.0.0')
编译文件(库/ Android的异步HTTP-1.4.8.jar')
编译文件(库/ Android的支持 - v4.jar')
编译文件(库/通用图像装载-1.9.4-与-sources.jar')
}
的误差是com.android.support:appcompat-v7:22.0.0包括支持-v4.jar,所以我将其删除;
解决的build.gradle:
{相关性
编译文件树(包括:['的* .jar'],DIR:库)
编译('com.android.support:appcompat-v7:22.0.0'){
排除模块:支持-V4
}
编译文件(库/ Android的异步HTTP-1.4.8.jar')
编译文件(库/ Android的支持 - v4.jar')
编译文件(库/通用图像装载-1.9.4-与-sources.jar')
}
所以也许ü应该检查乌拉圭回合的依赖,也许乌尔编译文件有两个文件包括支持-V4
I am able to build the Project successfully in Android Studio but when I am trying to run the application getting error like this "duplicate entry: android/support/v4/print/PrintHelper$1.class.",I have searched lot of sites and tried lot of suggestions but failed.Please help me..below is my code.I was struggled 2 days for this.
apply plugin: 'com.android.application'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':appcompat_v7')
compile project(':google-play-services_lib')
compile project(':Cognalys')
//noinspection GradleDynamicVersion
compile 'com.android.support:recyclerview-v7:22.2.+'
}
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
I meet the same error, and I solve it, but I just give u that my case;
my bulid.gradle:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile ('com.android.support:appcompat-v7:22.0.0')
compile files('libs/android-async-http-1.4.8.jar')
compile files('libs/android-support-v4.jar')
compile files('libs/universal-image-loader-1.9.4-with-sources.jar')
}
the error for is the com.android.support:appcompat-v7:22.0.0 include the support-v4.jar, so I remove it;
solve build.gradle:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile ('com.android.support:appcompat-v7:22.0.0') {
exclude module: 'support-v4'
}
compile files('libs/android-async-http-1.4.8.jar')
compile files('libs/android-support-v4.jar')
compile files('libs/universal-image-loader-1.9.4-with-sources.jar')
}
so maybe u should check ur dependencies, maybe ur compile files have two files include support-v4
这篇关于重复条目Android Studio中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!