다른 aar 및 jar 파일 종속성을 사용하여 AAR 파일을 만듭니다. .aar 릴리스 파일을 만들었습니다.Android Studio 다른 AAR 파일 및 jar 파일을 사용하여 AAR 만들기
그런 다음 새 AAR 파일을 샘플 프로젝트로 가져 왔습니다. 프로젝트가 정상적으로 실행 중입니다. 해당 aar 및 jar 클래스에 액세스하려고하면 NoClassDefFound 오류가 표시됩니다.
참고 : 먼저 다른 AAR 내부의 AAR이 가능하다는 것을 알고 싶습니다. 이 새로운 일들이 나올 때 누군가 도와 줄 수 있습니까?
나는이 링크를 Create an AAR with multiple AARs/JARs라고도합니다. transitive = true를 말하는 것입니다. 그러나, 그 깃발을 사용할 곳을 이해하지 못합니다. Application을 사용하거나 AAR 프로젝트 종속성 내에 AAR을 생성하는 동안 사용하는 제 3 자.
감사 사전.
내 미니 프로젝트 Gradle을 파일 : 만 .AAR 파일로 변환되어
미니 프로젝트. 다음,이 파일은 당신이 당신의 의존성에 AAR과 항아리를 참조 할 때, 당신은에 대한 참조와 함께 새로운 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'를 추가해야합니다. –
MainProject에 transitive = true를 추가했습니다. 하지만, 같은 오류가 발생했습니다. 가져온 aar에서 noclassdeffound 오류를 나타내는 특정 클래스가 있습니다. – harikrishnan
'build.gradle'의 코드를 게시하십시오. –