我在一个项目中工作,其中有一个重复的关键字:twitter occer;无法在Android studio中解决此错误
打开你的终端 转到根项目文件夹我在一个项目中工作,其中有一个重复的关键字:twitter occer;无法在Android studio中解决此错误,android,Android,打开你的终端 转到根项目文件夹 apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrary 'org.apache.http.legacy' defaultConfig { applicationId "com.mysocialreader" minSdkVersion 9
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.mysocialreader"
minSdkVersion 9
targetSdkVersion 23
multiDexEnabled true
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
configurations
{
all*.exclude module: 'gson';
all*.exclude group: 'com.android.support', module: 'support-annotations'
// all*.exclude module: 'iofabricsdkandroid_fabric'
compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
all*.exclude module: "iofabricsdkandroid_fabric_2"
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile files('libs/scribe-1.3.5.jar')
compile files('libs/signpost-commonshttp4-1.2.1.2.jar')
compile files('libs/signpost-core-1.2.1.2.jar')
compile files('libs/commons-codec-1.3.jar')
compile files('libs/io-fabric-sdk-android_fabric-classes.jar')
compile files('libs/universal-image-loader-1.9.2-with-sources.jar')
compile(files('libs/google-oauth-client-1.19.0.jar'))
compile('com.google.http-client:google-http-client-gson:1.19.0') {
exclude group: 'com.android.support', module: 'support-v4'
exclude(group: 'com.google', module: 'gson')
}
compile('com.google.api-client:google-api-client-android:1.19.0')
{
exclude(group: 'com.google', module: 'gson')
exclude group: 'com.google.guava', module: 'guava-jdk5'
}
compile('com.google.http-client:google-http-client-android:1.19.0')
{
exclude(group: 'com.google.android', module: 'android')
exclude(group: 'com.google', module: 'gson')
}
compile('com.google.android.gms:play-services:8.4.0')
{
exclude group: 'com.google', module: 'gson'
}
compile('com.google.android.gms:play-services-ads:8.4.0')
{
exclude group: 'com.google', module: 'gson'
}
compile('com.google.android.gms:play-services-identity:8.4.0')
{
exclude group: 'com.google', module: 'gson'
}
compile('com.google.android.gms:play-services-gcm:8.4.0')
{
exclude group: 'com.google', module: 'gson'
}
// compile project(':iofabricsdkandroid_fabric_2')
compile project(':facebookSdk')
compile project(':diffHeightsGridView')
compile project(':vKOpenAuthActivity')
compile project(':comtwittersdkandroid_twitter_2')
}
并将其添加到build.gradle文件中的配置部分
./gradlew clean
希望这对您有所帮助。打开您的终端
转到根项目文件夹
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.mysocialreader"
minSdkVersion 9
targetSdkVersion 23
multiDexEnabled true
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
configurations
{
all*.exclude module: 'gson';
all*.exclude group: 'com.android.support', module: 'support-annotations'
// all*.exclude module: 'iofabricsdkandroid_fabric'
compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
all*.exclude module: "iofabricsdkandroid_fabric_2"
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile files('libs/scribe-1.3.5.jar')
compile files('libs/signpost-commonshttp4-1.2.1.2.jar')
compile files('libs/signpost-core-1.2.1.2.jar')
compile files('libs/commons-codec-1.3.jar')
compile files('libs/io-fabric-sdk-android_fabric-classes.jar')
compile files('libs/universal-image-loader-1.9.2-with-sources.jar')
compile(files('libs/google-oauth-client-1.19.0.jar'))
compile('com.google.http-client:google-http-client-gson:1.19.0') {
exclude group: 'com.android.support', module: 'support-v4'
exclude(group: 'com.google', module: 'gson')
}
compile('com.google.api-client:google-api-client-android:1.19.0')
{
exclude(group: 'com.google', module: 'gson')
exclude group: 'com.google.guava', module: 'guava-jdk5'
}
compile('com.google.http-client:google-http-client-android:1.19.0')
{
exclude(group: 'com.google.android', module: 'android')
exclude(group: 'com.google', module: 'gson')
}
compile('com.google.android.gms:play-services:8.4.0')
{
exclude group: 'com.google', module: 'gson'
}
compile('com.google.android.gms:play-services-ads:8.4.0')
{
exclude group: 'com.google', module: 'gson'
}
compile('com.google.android.gms:play-services-identity:8.4.0')
{
exclude group: 'com.google', module: 'gson'
}
compile('com.google.android.gms:play-services-gcm:8.4.0')
{
exclude group: 'com.google', module: 'gson'
}
// compile project(':iofabricsdkandroid_fabric_2')
compile project(':facebookSdk')
compile project(':diffHeightsGridView')
compile project(':vKOpenAuthActivity')
compile project(':comtwittersdkandroid_twitter_2')
}
并将其添加到build.gradle文件中的配置部分
./gradlew clean
希望这能对您有所帮助。我可以在Android Studio中通过“构建>清理项目”来修复此问题。我可以在Android Studio中通过“构建>清理项目”来修复此问题。您可以发布完整的日志错误吗?是的,谢谢……错误:任务执行失败:应用程序:TransformClasses WithJarmergingfordebug'>com.android.build.api.transform.TransformException:java.util.zip.zipeException:duplicate entry:com/twitter/sdk/android/BuildConfig.class……我在运行我的项目时遇到了这个错误。你能发布你的完整日志错误吗?是的,谢谢……错误:任务执行失败:“:app:transformClasses with jarmergingfordebug.”>com.android.build.api.transform.TransformException:java.util.zip.zipeException:duplicate entry:com/twitter/sdk/android/BuildConfig.class……我在运行项目时遇到了这个错误。再次遇到了同样的问题。我尝试了所有解决方案。这个项目在eclipse中运行良好,但在android studio中没有。请给我建议其他解决办法。谢谢。你试过了吗。/gradlew从你的终端清理,也清理和构建你的项目。是的,先生,我正确地使用了你的解决方案。再次遇到同样的问题。我尝试了所有的解决方案。相同的项目在eclipse中运行良好,但在android studio中不行。请给我建议其他解决办法。谢谢。您尝试过了吗。/gradlew从您的终端进行清理,也清理和构建您的项目。是的,先生,我正确地使用了您的解决方案。