के अंदर जार का उपयोग करके एएआर बनाएं I am aar और jar फ़ाइल निर्भरता का उपयोग कर एएआर फ़ाइल बना रहा हूं। मैंने सफलतापूर्वक .aar रिलीज फ़ाइल बनाई है।एंड्रॉइड स्टूडियो एक और एएआर फ़ाइल और
फिर, मैंने नमूना परियोजना में अपनी नई एएआर फ़ाइल आयात की है। परियोजना ठीक चल रही है। जब उस आार और जार कक्षाओं का उपयोग करने के लिए जा रहा है, तो यह NoClassDefFound त्रुटि दिखा रहा है।
नोट: सबसे पहले मैं जानना चाहता हूं, अब एक और एएआर के अंदर एएआर संभव है या नहीं। क्या कोई मुझे इस नई चीजों के मुद्दे से बाहर निकलने में मदद कर सकता है?
मैंने इस लिंक को Create an AAR with multiple AARs/JARs पर भी संदर्भित किया। यह transitive = सच कह रहा है। लेकिन, समझ में नहीं आता, उस ध्वज का उपयोग कहां करें। आवेदन का उपयोग करते हुए या एएआर परियोजना निर्भरताओं के अंदर एएआर बनाने के दौरान तीसरे पक्ष में।
धन्यवाद अग्रिम।
मेरे मिनी परियोजना Gradle फ़ाइल:
मिनी परियोजना है, जो केवल .AAR फ़ाइल में परिवर्तित। तो, इस फ़ाइल को केवल उपयोग करने के लिए एक और NewProject
मिनी परियोजना Build.gradle फ़ाइल
/*
This would be enabled for development purpose and to debug and check the same
*/
apply plugin: 'com.android.application'
/*
This would be enabled for exporting as aar file
apply plugin: 'com.android.library'
*/
//apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries = false
}
defaultConfig {
/*
This application id would be used for development purpose and to debug and check the same.
This would be commented when exporting as library
*/
applicationId 'com.pss.pssplayer'
minSdkVersion 18
targetSdkVersion 23
multiDexEnabled true
versionCode 1
versionName "1.0"
}
aaptOptions {
cruncherEnabled = false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile files('libs/ksoap2-android-assembly-3.2.0-jar-with-dependencies.jar')
compile files('libs/secure.jar')
compile(project(':getSubProject')) {
transitive = true
}// this getSubProject also contains one classes jar
}
आपको निर्भरता में 'transitive = true' जोड़ना होगा जिसमें आप अपनी मुख्य परियोजना में शामिल हैं। –
मैंने मुख्यप्रोजेक्ट में transitive = true के लिए जोड़ा। लेकिन, मुझे एक ही त्रुटि मिल रही है। एक विशेष वर्ग आयातित आर्म से नॉकलासडेफॉउंड त्रुटि दिखा रहा है। – harikrishnan
कृपया 'build.gradle' का कोड पोस्ट करें। –