Create an Android library module with resources

时间:2015-07-28 15:44:33

标签: java android android-studio module shared-libraries

I need to build an Android library, that has JAR dependency that represents the java code and res folder that includes all the drawables and different XMLs.

I use Android studio as my IDE.

From what I know, I need to create a module, set it as a library in the build.gradle file by adding apply plugin: 'android-library' and simply add this module as a dependency in the other module that uses it.

When I'm trying to activate my sample application with my library, I'm getting NoClassDefFoundError exception because he can't find one of the layouts I created.

The exact error(without the package name):

java.lang.NoClassDefFoundError: .R$layout

I tried everything by now without any success, what I forgot to do?

P.S. I know that I can use AAR, but I need it to fit with all IDEs, and from what I know Eclipse(I know Google stopped support it) and intellij doesn't support it.

Any insights will be greatly appreciated.

0 个答案:

没有答案