मैं अपने एंड्रॉयड निर्माण में Gradle का उपयोग कर https://github.com/Kickflip/kickflip-android-sdk आयात करने के लिए कोशिश कर रहा हूँ और मैं हो रही है:Gradle निर्भरता से छोड़कर .class फ़ाइलों
अप्रत्याशित शीर्ष-स्तर अपवाद: com.android.dex.DexException: एकाधिक डीएक्स फाइलें लॉर्ग/अपाचे/कॉमन्स/कोडेक/बाइनरी/बेस 64 को परिभाषित करती हैं;
Commons.codec मेरी परियोजना की निर्भरता है, लेकिन सीधे किक-फ्लिप परियोजना से नहीं, मुझे लगता है कि यह वहां शामिल जारों में से एक से आ रहा है। यदि मैं किकफ्लिप के वर्ग खोलता हूं तो मैं .class फ़ाइलों को देख सकता हूं .jar।
मैं बेस 64.class को अंतिम निर्माण में किकफ्लिप से आयात करने से कैसे बाहर कर सकता हूं? मैंने चीज़ों को बाहर करने के लिए ज़िप्ट्री का उपयोग करने पर ध्यान दिया है लेकिन काम करने के लिए कुछ भी नहीं मिला है।
धन्यवाद
मेरे build.gradle है:
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 10
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/ASL2.0'
}
android.applicationVariants.all{ variant ->
// This is an annoying hack to get around the fact that the Gradle plugin does not support
// having libraries with different minSdkVersions. Play Services has a min version of 9 (Gingerbread)
// but Android Maps Utils supports 8 (Froyo) still
variant.processManifest.doFirst {
File manifestFile = file("${buildDir}/exploded-aar/io.kickflip/sdk/0.9.9/AndroidManifest.xml")
if (manifestFile.exists()) {
println("Replacing minSdkVersion in Android Maps Utils")
String content = manifestFile.getText('UTF-8')
content = content.replaceAll(/minSdkVersion="18"/, 'minSdkVersion=\"10\"')
manifestFile.write(content, 'UTF-8')
println(content)
}
}
}
}
dependencies {
compile 'com.android.support:support-v4:19.1.0'
compile 'io.kickflip:sdk:0.9.9'
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':libs:typeface-textview:library')
compile project(':libs:gpuimage')
compile 'com.google.android.gms:play-services:4.3.23'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.koushikdutta.urlimageviewhelper:urlimageviewhelper:1.0.4'
compile ('fr.avianey:facebook-android-api:3.14.0') {
exclude module: 'support-v4'
}
compile 'com.github.japgolly.android:svg-android:2.0.1'
compile 'org.scribe:scribe:1.3.5'
compile 'commons-codec:commons-codec:1.8'
}
मैं देख रहा हूँ के रूप में लगता है कि kickflip न्यूनतम Android SDK संस्करण की आवश्यकता है 18. और आपकी बिल्ड फ़ाइल minSdkVersion 10 को परिभाषित करती है। यह एक समस्या हो सकती है। – Genry
मैंने इसे भी बनाने की कोशिश की। ऐसा लगता है कि वे उपकरण 1 9 .1 का निर्माण करना चाहते हैं और ग्रैडल कमांड लाइन से निर्माण करने के लिए कह रहे हैं। मैं एंड्रॉइड स्टूडियो पर हूं इसलिए उदाहरण सिर्फ पुराने संस्करण के बारे में शिकायत करने के लिए पुराने होने के बारे में शिकायत करते हैं। ग्रहण के लिए आसान डाउनलोड बटन developer.android.com से चला गया है। – Giuseppe
मुझे एक्लिप्स में पहले कई डीएक्स त्रुटियां मिल गई हैं, इसे आम तौर पर गलत लाइब्रेरी लिंकेज या शायद एक लाइब्रेरी को कई बार शामिल किया जाना पड़ता है। शायद यही कारण है कि वे ग्रैडल कमांड लाइन बिल्ड के उपयोग का सुझाव दे रहे हैं। – Giuseppe