2016-05-29 17 views
0

私のgradleファイルで何が間違っていますか?

apply plugin: 'com.android.application' 
 

 
android { 
 
    compileSdkVersion 23 
 
    buildToolsVersion "23.0.2" 
 

 
    defaultConfig { 
 
     applicationId "com.example.oumnia.advalio" 
 
     minSdkVersion 15 
 
     targetSdkVersion 23 
 
     versionCode 1 
 
     versionName "1.0" 
 
     multiDexEnabled true 
 

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

 
    packagingOptions { 
 
     exclude 'META-INF/DEPENDENCIES' 
 
     exclude 'META-INF/NOTICE' 
 
     exclude 'META-INF/LICENSE' 
 
     exclude 'META-INF/LICENSE.txt' 
 
     exclude 'META-INF/NOTICE.txt' 
 
    } 
 
    useLibrary 'org.apache.http.legacy' 
 
} 
 

 
dependencies { 
 
    compile 'com.android.support:appcompat-v7:23.2.0' 
 
    compile 'com.android.support:design:23.2.0' 
 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
 
    //compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' 
 
    //compile 'com.google.android.gms:play-services:8.4.0' 
 
    compile 'com.google.android.gms:play-services-maps:8.4.0' 
 
    compile 'com.google.android.gms:play-services-location:8.4.0' 
 
    //compile "org.apache.httpcomponents:httpcore:4.2.4" 
 
    //compile "org.apache.httpcomponents:httpmime:4.3" 
 
    //compile project(':httpmime-4.3.1') 
 
    //compile project(':httpcore-4.2.3') 
 
    //compile project(':httpclient-4.5.2') 
 
    compile "org.apache.httpcomponents:httpcore:4.2.4" 
 
    compile "org.apache.httpcomponents:httpmime:4.3" 
 
    compile project(':httpmime-4.3.1') 
 
    compile project(':httpcore-4.2.3') 
 

 
}

私はこのエラーエラーを取得:実行は、タスクに失敗しました ':アプリ:transformClassesWithJarMergingForDebug'。

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/http/HttpMessage.class

誰かが私のgradleファイルに間違いを教えてもらえますか?

apply plugin: 'com.android.application' 
 

 
android { 
 
    compileSdkVersion 23 
 
    buildToolsVersion "23.0.2" 
 

 
    defaultConfig { 
 
     applicationId "com.example.oumnia.advalio" 
 
     minSdkVersion 15 
 
     targetSdkVersion 23 
 
     versionCode 1 
 
     versionName "1.0" 
 
     multiDexEnabled true 
 

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

 
    packagingOptions { 
 
     exclude 'META-INF/DEPENDENCIES' 
 
     exclude 'META-INF/NOTICE' 
 
     exclude 'META-INF/LICENSE' 
 
     exclude 'META-INF/LICENSE.txt' 
 
     exclude 'META-INF/NOTICE.txt' 
 
    } 
 
} 
 

 
dependencies { 
 
    compile 'com.android.support:appcompat-v7:23.2.0' 
 
    compile 'com.android.support:design:23.2.0' 
 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
 
    compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' 
 
    //compile 'com.google.android.gms:play-services:8.4.0' 
 
    compile 'com.google.android.gms:play-services-maps:8.4.0' 
 
    compile 'com.google.android.gms:play-services-location:8.4.0' 
 
    //compile "org.apache.httpcomponents:httpcore:4.2.4" 
 
    //compile "org.apache.httpcomponents:httpmime:4.3" 
 
    compile project(':httpmime-4.3.1') 
 
    compile project(':httpcore-4.2.3') 
 
}

答えて

0

あなたはAPI 23を使用してコンパイルやAndroidタグ内に次の行を追加しようとしている場合、Apacheのlibが削除

useLibrary 'org.apache.http.legacy'

+0

私はコンパイル 'org.jbundle.util.osgi.wrappedを置き換える必要があることを意味する:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' – develop1

+0

コンパイルSDKのバージョンを21に変更し、buid –

+0

u私はこの行を置き換える必要があることを意味するcompile'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2 'これでコンパイルする' org.apache.http.legacy '?? – develop1

関連する問題