Add the dependencies in your app-level Gradle build file. View the sample application for examples of an SDK file built with Gradle.

  1. Add the JAR and AAR files to the dependencies section, ensuring to change the names to match the names and versions of the library files.

    def supportLibraryVersion   = “26.0.2”
                            dependencies {
                            compile fileTree(dir: ‘libs’, include: [‘*.jar’])
                            compile ‘com.android.support:multidex:1.0.1’
                            //Integrate with sdk client: 
                            compile (name:‘AirWatchSDK-18.2’, ext:‘aar’)
                            //integrate with framework:
                            compile (name:‘CredentialsExt-18.2’, ext:‘aar’)
                            compile (name:‘AWFramework-18.2’, ext:‘aar’)
                            compile ‘com.google.android.gms:play-services-safetynet:11.4.2’
                            compile “com.android.support:support-v13:${supportLibraryVersion}”
                            compile “com.android.support:appcompat-v7:${supportLibraryVersion}”
                            compile “com.android.support:cardview-v7:${supportLibraryVersion}”
                            compile “com.android.support:recyclerview-v7:${supportLibraryVersion}”
                            compile “com.android.support:design:${supportLibraryVersion}”
                            compile “com.mixpanel.android:mixpanel-android:4.+”
                            compile”com.android.support:preference-v14:${supportLibraryVersion}”    
                            compile ‘net.zetetic:android-database-sqlcipher:3.5.7@aar’
                            }
                            
                            
                            
                         
  2. Add a packagingOptions block with these exclusions.

    packagingOptions {
                            exclude 'META-INF/LICENSE.txt'
                            exclude 'META-INF/NOTICE.txt'
                            }
                            
                            
                            
                         
  3. Add a dexOptions block with these values.

    dexOptions {
                            jumboMode = true
                            preDexLibraries false
                            javaMaxHeapSize "4g"
                            }
                            
                            
                            
                         
  4. Set the compileSDK to 26, the build tools to 26.0.1, and the targetSDKVersion to 25, all of which reside in the defaultConfig block.

    def compileSdk     = 26
                            def buildTools     = "26.0.1"
                            defaultConfig {
                            minSdkVersion 15
                            targetSdkVersion 25
                            multiDexEnabled true
                            vectorDrawables.useSupportLibrary = true
                            //to force fw to be merged with app when the aar included
                            consumerProguardFiles file('proguard.cfg')
                            ndk {
                            abiFilters "x86", "armeabi-v7a", "armeabi"
                            } 
                            }
                            
                            
                            
                         
  5. Sync your project with the Gradle files.