Skip to main content

Gradle Configuration (Android)

To set up your Android Development Environment
  1. Open the project gradle file. 
  2. Add the following entries into the project build.gradle file:

    CODE
    buildscript {
      ext.kotlin_version = '{latest_version}' // https://kotlinlang.org/releases.html​​​
      ext.objectbox_version = '{latest_version}' ​// https://docs.objectbox.io/#objectbox-changelog​
      ext.libVersion = '{cantara_client_6_version}'
    
      repositories {
        maven {
          credentials {
            username repoUsername
            password repoPassword
          }
          ​url "${repoUrl}artifactory/libs-release"
        }
        maven {
          credentials {
            username repoUsername
            password repoPassword
          }
          url "${repoUrl}artifactory/libs-snapshot"
        }
        google()
        jcenter()
    
      }
      dependencies {
        classpath "com.android.tools.build:gradle:{latest_version}" // Gradle plugin
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // Kotlin plugin
        classpath "androidx.n​​avigation:navigation-safe-args-gradle-plugin:{latest_version}" // AndroidX navigation plugin used in the base login activity for the login and setting fragments
        classpath "com.google.gms:google-services:{latest_version}"​ // Google services plugin used for any firebase related tasks such as barcode scanning..etc
        classpath "com.rinami.cantara.client.android:cantara-android-plugin:$libVersion" // Cantara entity generation plugin used to generate final object classes 
        classpath "io.objectbox:objectbox-gradle-plugin:$objectbox_version" //​ Object Box plugin used for local storage
      }
    }​
  3. Add Cantara Android plugin and Objectbox plugin to your app gradle file (projectRoot/app/build.gradle): 

    CODE
    plugins {
      id 'com.android.application'
      id 'kotlin-android'
      id 'kotlin-android-extensions'
      id 'androidx.navigation.safeargs.kotlin'
      id 'kotlin-kapt'
      id 'cantara-android-plugin'
      id 'io.objectbox'
    }​
  4. Include Cantara Implementation in your app module, as a gradle compile dependency (projectRoot/app/build.gradle):

    CODE
    implementation "com.rinami.cantara.client.android:cantara-android-implementation:$libVersion"
  5. Create a "gradle.properties" file in your ".gradle" root directory and add the following entries. Note: will be provided during Cantara set up. 

    CODE
    repoUsername={RepoUsername}
    repoPassword={RepoPassword}
    repoUrl={RepoUrl}
  6. Add the following to the app build.gradle file:

    CODE
    decode {
      sourcePackage "com.rinami.cantara.client.android.schema"
      destinationPackage "{applicationId}"
      customFilePath ""
    }
  7. Add the following to the app build.gradle file:

    CODE
    afterEvaluate { project ->
      assembleRelease.dependsOn tasks.getByName('decodeRelease')
    }​​





JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.