2017-10-25 15 views
6

मैं इस मुद्दों को ठीक कर सकते हैं, जबकि एंड्रॉयड स्टूडियो में रिलीज निर्माण संकलन 3.0 RC2त्रुटि

Error:Error: commons-logging defines classes that conflict with classes now provided by Android. Solutions include finding newer versions or alternative libraries that don't have the same problem (for example, for httpclient use HttpUrlConnection or okhttp instead), or repackaging the library using something like jarjar. [DuplicatePlatformClasses]

Error:Error: httpclient defines classes that conflict with classes now provided by Android. Solutions include finding newer versions or alternative libraries that don't have the same problem (for example, for httpclient use HttpUrlConnection or okhttp instead), or repackaging the library using something like jarjar. [DuplicatePlatformClasses]

मेरे build.gradle

compile 'net.zetetic:android-database-sqlcipher:[email protected]' 
compile('com.crashlytics.sdk.android:crashlytics:2.6.6[email protected]') { 
    transitive = true; 
}  
compile 'com.android.support:appcompat-v7:26.1.0' 
compile 'com.android.support:support-v4:26.1.0' 
compile 'com.android.support:cardview-v7:26.1.0' 
compile 'com.android.support:recyclerview-v7:26.1.0' 
compile 'com.android.support:design:26.1.0' 
compile 'com.android.support:multidex:1.0.2' 
compile project(':rangebar') 
compile project(':expandablerecyclerview') 
compile project(':materialsearchview') 
// Play Services 
compile 'com.google.android.gms:play-services-auth:11.4.2' 
compile 'com.google.android.gms:play-services-analytics:11.4.2' 
compile 'com.google.android.gms:play-services-plus:11.4.2' 
compile 'com.google.android.gms:play-services-maps:11.4.2' 
compile 'com.google.android.gms:play-services-location:11.4.2' 
compile 'com.google.android.gms:play-services-places:11.4.2' 
compile 'com.google.android.gms:play-services-wearable:11.4.2' 
compile 'com.google.android.gms:play-services-fitness:11.4.2' 
// Firebase 
compile 'com.google.firebase:firebase-core:11.4.2' 
compile 'com.google.firebase:firebase-messaging:11.4.2' 
compile 'com.google.api-client:google-api-client:1.22.0' 
compile 'com.google.apis:google-api-services-people:v1-rev66-1.22.0' 
// Just GSON 
compile 'com.google.code.gson:gson:2.8.0' 
// Don't remember what is it about 

// View binder 
compile 'com.jakewharton:butterknife:8.8.1' 
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' 
// Social SDK's 
compile 'com.facebook.android:facebook-android-sdk:4.20.0' 
// Glide libs 
compile 'com.github.bumptech.glide:glide:3.7.0' 
compile 'jp.wasabeef:glide-transformations:2.0.1' 
// SquareUp libs 
compile 'com.squareup.okio:okio:1.13.0' 
compile 'com.squareup.retrofit2:retrofit:2.3.0' 
compile 'com.squareup.retrofit2:converter-gson:2.3.0' 
compile 'com.squareup.retrofit2:adapter-rxjava:2.2.0' 
compile 'com.squareup.okhttp3:logging-interceptor:3.7.0' 
compile 'com.squareup.okhttp3:okhttp:3.9.0' 
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.7.0' 
compile 'com.google.dagger:dagger:2.11' 
compile 'com.google.dagger:dagger-android-support:2.11' 
annotationProcessor 'com.google.dagger:dagger-compiler:2.11' 
compile 'com.github.florent37:dagger-auto-inject:1.0.0' 
annotationProcessor 'com.github.florent37:dagger-auto-inject-compiler:1.0.0' 
compile('com.hwangjr.rxbus:rxbus:1.0.5') { 
    exclude group: 'com.jakewharton.timber', module: 'timber' 
} 
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1' 
// ? 
compile 'it.neokree:MaterialTabs:0.11' 
// ? 
compile 'com.getbase:floatingactionbutton:1.10.1' 
compile 'com.github.castorflex.smoothprogressbar:library:1.1.0' 
compile 'com.yqritc:recyclerview-flexibledivider:1.4.0' 
compile 'com.pnikosis:materialish-progress:1.7' 
compile 'com.r0adkll:slidableactivity:2.0.5' 
compile 'com.github.asyl.animation:arcanimator:1.0.0' 
compile 'com.pacioianu.david:ink-page-indicator:1.2.0' 
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.6' 
// Circular adapter for picker 
compile 'com.mobsandgeeks:adapter-kit:0.5.3' 
// RX libs 
compile 'io.reactivex:rxandroid:1.2.1' 
compile 'io.reactivex:rxjava:1.3.0' 
compile 'com.wdullaer:materialdatetimepicker:3.3.0' 
compile 'com.github.aakira:expandable-layout:[email protected]' 
compile 'com.google.maps.android:android-maps-utils:0.5' 
compile 'com.mikhaellopez:circularimageview:3.0.2' 
//CALENDAR 
compile 'joda-time:joda-time:2.9.9' 
compile 'com.googlecode.libphonenumber:libphonenumber:8.3.2' 
compile 'com.github.deano2390:MaterialShowcaseView:1.1.0' 
compile 'me.leolin:ShortcutBadger:[email protected]' 
compile 'com.prolificinteractive:material-calendarview:1.4.3' 
compile 'net.time4j:time4j-android:3.29-2017a' 
// TODO CHECK 
compile 'com.github.michael-rapp:android-material-dialog:4.0.1' 
compile 'com.daimajia.swipelayout:library:[email protected]' 
compile 'com.jakewharton.rxbinding:rxbinding:1.0.0' 
// TODO CHECK 
compile 'me.zhanghai.android.materialratingbar:library:1.0.2' 
compile 'com.github.markomilos:paginate:0.5.1' 
compile 'com.github.jimcoven:jcropimageview:0.22' 
compile 'ru.egslava:MaskedEditText:1.0.5' 
compile 'com.github.delight-im:Android-SimpleLocation:v1.0.1' 
+0

टर्मिनल के अंदर 'निर्भरता को धीरे-धीरे' करने का प्रयास करें। – Ibrahim

+0

'gradlew ऐप के लिए आउटपुट जोड़ें: निर्भरता - कॉन्फ़िगरेशन रिलीज कॉम्पाइल क्लासपाथ' – DeKaNszn

+0

देखें [एक और स्टैक ओवरफ्लो उत्तर] (https://stackoverflow.com/a/46995816/2877004) – Alecs

उत्तर

3

जोड़ें एप्लिकेशन मॉड्यूल में स्थित build.gradle को

configurations { 
    all { 
     exclude module: 'httpclient' 
     exclude module: 'commons-logging' 
    } 
} 
+1

क्या आप समस्या की व्याख्या कर सकते हैं? और जब मैं इसे जोड़ता हूं तो त्रुटि के बारे में httpclient लाइब्रेरी नहीं मिल सकती है। – UnKnown

+0

यह मेरे लिए काम नहीं कर रहा है। मुझे त्रुटि मिल रही है: त्रुटि: जेसन उन कक्षाओं को परिभाषित करता है जो एंड्रॉइड द्वारा प्रदान की गई कक्षाओं के साथ संघर्ष करते हैं। समाधानों में नए संस्करण या वैकल्पिक पुस्तकालयों को ढूंढना शामिल है जिनमें एक ही समस्या नहीं है (उदाहरण के लिए, httpclient के लिए HttpUrlConnection या okhttp का उपयोग करें), या लाइजर जैसे कुछ का उपयोग करके लाइब्रेरी को पुन: पैकेज करना। [DuplicatePlatformClasses]। – hitesh141

1

मैं इस तय है एक साफ/पुनर्निर्माण के साथ। यह भी सुनिश्चित करें कि एनोटेशन प्रोसेसर 'com.github.bumptech.glide: कंपाइलर: 4.2.0' ग्लाइड के लिए आपके ग्रेडल में।

dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 

compile 'com.github.PhilJay:MPAndroidChart:v3.0.1' 
compile 'com.github.recruit-lifestyle:FloatingView:2.2' 
compile 'com.dropbox.core:dropbox-core-sdk:3.0.5' 
compile 'com.squareup.okio:okio:1.13.0' 
compile 'com.squareup.okhttp3:okhttp:3.9.0' 
compile 'com.github.bumptech.glide:glide:4.2.0' 
compile 'com.opencsv:opencsv:4.0' 
compile 'com.android.support:appcompat-v7:26.1.0' 
compile 'com.android.support:recyclerview-v7:26.1.0' 
compile 'com.android.support:cardview-v7:26.1.0' 
compile 'com.android.support:design:26.1.0' 
compile 'com.android.support:preference-v7:26.1.0' 
compile 'com.android.support:preference-v14:26.1.0' 
compile 'com.google.android.gms:play-services-vision:11.4.2' 
compile 'com.google.android.gms:play-services-places:11.4.2' 

annotationProcessor 'com.github.bumptech.glide:compiler:4.2.0' 
} 
1

कोड के इस टुकड़े करके एक ही त्रुटि मैं तय एप्लिकेशन/build.gradle

configurations { 
    all { 
     exclude module: 'httpclient' 
     exclude module: 'commons-logging' 
    } 
} 
1

में जोड़ने के ...

android { 
... 

configurations { 
    all { 
     exclude module: 'httpclient' 
     exclude module: 'json' 
     exclude group: 'org.apache.httpcomponents' 
    } 
} 

... 
} 
संबंधित मुद्दे