android studio import an existing android studio project to use as lib

 

New project is coming. A framework needs to be built. Android studio is still very unfamiliar to me. A previous project built an environment with the help of my colleagues, and it was completely covered up.

So prepare to describe the construction process in as much detail as possible, in case you need it in the future.

1. Create a new blank project

2. Create a new projectlibs folder under the app folder

3. Copy the project that needs to be imported (for example, the name is xandroidlib)

4.修改settings.gradle文件:
include ':app:projectLibs:xandroidlib'

5.修改build.gradle文件:
dependencies {   
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile project(':app:projectLibs:eshorelib')  
}

6.Buile-Rebuild Project is ready to use after waiting for completion. It is very different from eclipse's import library steps.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325190755&siteId=291194637