2016-03-16 28 views
0

我將源代碼從Eclipse遷移到Android studio,當我在android studio中構建項目時,失敗後。

失敗:生成失敗,出現異常。

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/print/PrintHelper$1.class

apply plugin: 'android' 

dependencies { 
    compile fileTree(dir: 'libs', include: '*.jar') 
    compile (project(':facebook')){ 
    exclude group: 'com.android.support', module: 'multidex' 
} 
    compile project(':libraryBasePera') 
    compile project(':google-play-services_lib') 
    compile 'com.android.support:multidex:1.0.1' 

} 

android { 
compileSdkVersion 21 
buildToolsVersion '21.1.2' 

defaultConfig { 

    minSdkVersion 14 
    targetSdkVersion 21 

    // Enabling multidex support. 
    multiDexEnabled true 
} 

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

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') 

    // Move the build types to build-types/<type> 
    // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ... 
    // This moves them out of them default location under src/<type>/... which would 
    // conflict with src/ being used by the main source set. 
    // Adding new build types or product flavors should be accompanied 
    // by a similar customization. 
    debug.setRoot('build-types/debug') 
    release.setRoot('build-types/release') 
} 
} 

我嘗試過很多辦法(排除模塊支持-V4,刪除支持-V4罐,乾淨,重建項目...),但我仍然堅持在這裏。任何人都可以幫助我找出問題嗎?

非常感謝。

回答

0

嘗試檢查lib文件夾。我有同樣的錯誤,因爲我錯誤地在我的lib文件夾中添加了support-v4 jar

相關問題