Empty folder importing external library

2019-07-15 05:53发布

问题:

I want to import to my android project an external library: CouchBase lite I have cloned the library using Git

$ git clone git://github.com/couchbase/couchbase-lite-android.git

as well the submodules

git submodule update --init --recursive

In order to import the library to my Android project I am doing: file->New->Import Module

This screen is showing:

After click on finish, the project has been imported but the folder couchbase-lite-android appears empty as can see:

That is not correct as you can see in the local source folder which I used to import the library:

In fact I need to use the class AndroidContext from that library but it is not available .

This is my setting.gradle

include ':couchbase-lite-java-forestdb', ':libraries:couchbase-lite-java-core'

About the build.gradle I have a few:

This is my build.gradle(Module:app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "com.example.jcr61782.importaingcoach"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    compile project(path: ':libraries:couchbase-lite-java-core')

}

What I am doing wrong?