A newer version of this documentation is available.

View Latest

Installing Couchbase Lite on Android

      +

      Description — How to install Couchbase Lite on Android
      Abstract — Getting you up and running quickly with Couchbase Lite on java-android

      Create or open an existing Android Studio project and install Couchbase Lite using the following method.

      Make the following additions to the module-level build.gradle file (typically in the app folder). Note: In the gradle examples replace the $2.8 token with the required Couchbase Lite version number.

      • Community

      • Enterprise

      1. Include the following in the android {} section:

        android {
            // Required only if your project has some Kotlin source code
            kotlinOptions { jvmTarget = '1.8' }
        
            // Set minimum JVM level to ensure availability of, for example, lambda expressions
            compileOptions {
                targetCompatibility 1.8
                sourceCompatibility 1.8
            }
        
        //   ... other section content as required by user
        }
      2. Include the following in the dependencies{} section:

        dependencies {
            implementation "com.couchbase.lite:couchbase-lite-android:${version}"
        
        //   ... other section content as required by user
        }
      1. Include the following in the android {} section:

        android {
            // Required only if your project has some Kotlin source code
            kotlinOptions { jvmTarget = '1.8' }
        
            // Set minimum JVM level to ensure availability of, for example, lambda expressions
            compileOptions {
                targetCompatibility 1.8
                sourceCompatibility 1.8
            }
        
        //   ... other section content as required by user
        }
      2. Include the following in the dependencies{} section:

        dependencies {
            implementation "com.couchbase.lite:couchbase-lite-android-ee:${version}"
        
        //   ... other section content as required by user
        }
      3. Include the following in the repositories {} section:

        repositories {
            maven { url 'https://mobile.maven.couchbase.com/maven2/dev/' }
            google()
            jcenter()
        
        //   ... other section content as required by user
        }