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 a repositories block.

    repositories{
                            flatDir{
                            dirs 'libs'
                            }
                            }
                            
                            
                            
                         
  2. 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.

    dependencies {
                            	compile fileTree(dir: 'libs', include: ['*.jar'])
                            
                            	compile 'com.android.support:multidex:1.0.1'
                            compile "com.android.support:support-v13:25.3.1"
                            compile "com.android.support:appcompat-v7:25.3.1"
                            compile "com.android.support:cardview-v7:25.3.1"
                            compile "com.android.support:recyclerview-v7:25.3.1"
                            compile "com.android.support:design:25.3.1"
                            	compile "com.android.support:preference-v14:25.3.1"
                            	compile 'com.google.android.gms:play-services-safetynet:9.6.1'
                            	compile 'net.zetetic:android-database-sqlcipher:3.5.7@aar'
                            	compile "com.mixpanel.android:mixpanel-android:4.+"
                            	compile (name:'AirWatchSDK-17.6.1', ext:'aar')
                            	compile (name:'AWFramework-17.6.1', ext:'aar')
                            }
                            
                            
                            
                         
  3. Add a packagingOptions block with these exclusions.

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

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

    def compileSdk     = 25
                            def buildTools     = "25.0.3"
                            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"
                            } 
                            }
                            
                            
                            
                         
  6. Sync your project with the Gradle files.