2017-09-18 11 views
0

これはgradle.buildファイルで、kitkat 4.4でエラーをスローします。 .2。しかし、そのは、キットカットでサポートするために、互換性の問題を解決するためにどのようにノーティー、Mashmallowでの作業とcom.android.build.api.transform.TransformException:java.util.zip.ZipException:重複エントリ:android/support/v4/app/FragmentActivity.class

- The code used in gradle file 
- The code block is supporting higher versions than kitkat but not supporting with kitkat 

をロリポップ

android { 
     compileSdkVersion 26 
     buildToolsVersion "26.0.1" 
     useLibrary 'org.apache.http.legacy' 
     defaultConfig { 
      applicationId "com.example.deneebo.ffconnect" 
      minSdkVersion 16 
      targetSdkVersion 26 
      versionCode 1 
      versionName "1.0" 
      multiDexEnabled true 
      testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
      vectorDrawables.useSupportLibrary = true 
     } 
     buildTypes { 
      release { 
       minifyEnabled false 
       proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      } 
     } 
     dexOptions { 
      javaMaxHeapSize "4g" //specify the heap size for the dex process 
     } 
    } 
    dependencies { 
     compile fileTree(dir: 'libs', include: ['*.jar']) 
     androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
      exclude group: 'com.android.support', module: 'support-annotations' 
     }) 
     compile('org.eclipse.paho:org.eclipse.paho.android.service:1.0.2') { 
      exclude module: 'support-v4' 
     } 
     compile 'com.android.support:appcompat-v7:25.3.1' 
     compile 'com.android.support.constraint:constraint-layout:1.0.2' 
     compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.7' 
     compile 'com.android.support:design:25.3.1' 
     compile 'com.android.support:support-vector-drawable:25.3.1' 
     compile 'com.android.support:support-v4:25.3.1' 
     testCompile 'junit:junit:4.12' 
     compile 'com.android.support:multidex:1.0.0' 
     compile 'com.android.support:multidex:1.0.1' 
     compile 'com.android.support:appcompat-v7:23.1.1' 
     compile 'com.android.support:support-v4:23.0.1' 
    }` 

答えて

1

java.util.zip.ZipException:重複したエントリ:

build.gradleセクションを修正してください。

dependencies { 
     compile fileTree(dir: 'libs', include: ['*.jar']) 
     androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
      exclude group: 'com.android.support', module: 'support-annotations' 
     }) 

     compile 'com.android.support:appcompat-v7:25.3.1' 
     compile 'com.android.support.constraint:constraint-layout:1.0.2' 
     compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.7' 
     compile 'com.android.support:design:25.3.1' 
     compile 'com.android.support:support-vector-drawable:25.3.1' 
     testCompile 'junit:junit:4.12' 
     compile 'com.android.support:multidex:1.0.1' 
     compile group: 'org.eclipse.paho', name: 'org.eclipse.paho.android.service', version: '1.0.2' 
    } 

その後Clean-Rebuild実行

+0

#DeKaNsznありがとうございました。 –

+0

あなたの返事に感謝、私はこれが好きでしたが、動作しませんでした。 –

+0

サポートv7ライブラリにはv4ライブラリが含まれていますか?なぜ両方のライブラリを入力する必要がありますか? @IntelliJAmiya –

関連する問題