RE HOW TO CREATE AN EXISTING PROJECT ANDROID STUDIO PROGRAM IN THE LIBRARY
-
- Change build.gradle of your module (not root build.gradle)
replace apply plugin: 'com.android.application' (with) apply plugin: 'com.android.library'
Remove the application from the same build.gradle project as described below
defaultConfig {
applicationId "com.example.packageName"//remove this line
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
After that, synchronize the gradle file. Now your project has been marked as a library, but to create a version of the library version you need to use this library in the module, so we will create a new module in the same project, to create a new module go to
File-> New module-> (select) phone and tablet Application-> next ..... Let the new module be created B.
Now add the library dependency A on module B as described by @Sam Rad #here
http://stackoverflow.com/questions/16588064/how-do-i-add-a-library-project-to-the-android-studio
Run the project, after succesfull Run you will find the version version of the library in the folder
1. A->build->outputs-> (.aar package Release version)
,