I built one android studio project. I wanted to use it as a library in another project. I followed below steps for same:
- Changed apply plugin: 'com.android.application' to 'com.android.library'
- Removed applicationId from defaultConfig{}
- Clicked on sync
This gave me .aar file in build-->outputs-->aar-->myapp.aar
I imported this .aar file in my other test project. I followed below steps for this:
- File-->New-->New module-->Import .jar/.aar package-->myapp.aar
- In build.grade of test application added compile project(path: ':myapp')
- Clicked on sync.
This produced one folder inside external libraries called myapp-unspecified. There i get all res files but i did not get the class files inside classes.jar. Inside classes.jar I only have MANIFEST.MF.
Am I doing something wrong or am I missing something??
Ran into the same issue. The classes are actually there or at least were for me. All that I needed to do was right click the application I was importing my library into. Click open module settings. Then go to dependencies on the right side. Add your library there as well so that the java will compile will your application.