I'm new to Android and Kotlin and I'm building a library but I have trouble packing it. How can you pack an .aar when you have another external dependicy in it? I need to parse some JSON, so I added Klaxon as a dependency in the module's build.gradle file like this
dependencies {
implementation ('com.beust:klaxon:5.0.1')
}
I also generate a .pom file where this is listed as a dependency.
When trying to add this locally in a demo app that uses the library, I put the .arr and .pom file in the libs folder of the project and add the arr file as a dependency in the demo app build.gradle but for some reason the app can't see Klaxon.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation files('libs/connatixplayersdk-release.aar')
}
also added flatDir to the project build.gradle
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
I tried to use transitive=true in my module build.gradle, but it doesn't seem to work
implementation ('com.beust:klaxon:5.0.1'){transitive=true}
Also, I saw this response, but it referes to an .aar with an .aar dependency