简体   繁体   中英

Android library modules sources not present in .aar file

I'm writing an Android library. It depends on another Android library module.

  • library
  • librarymodule

library depends on librarymodule like this:

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
    ...
}

dependencies {
    ...
    implementation project(":librarymodule")
}

I would like to export library as.arr file to use in applications but the content of librarymodule is not packaged into the resulting.aar file. If I try to use this library in an application it produces the following error:

java.lang.ClassNotFoundException: Didn't find class "class from librarymodule" on path: ...

How can I package the sources of librarymodule into the library.aar file to ship it as one library?

Try creating a pom.xml file that includes the necessary sources to be used in the app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM