-2

i had modified the build.gradle file for configuring multidex also i had a study in the official documentation ,but the new problem is "Too much of methods in main dex" how to reduce the methods in main dex

build.gradle

apply plugin: 'com.android.application'



android {

defaultConfig {
    compileSdkVersion 23
    buildToolsVersion '23.0.1'
    minSdkVersion 14 //lower than 14 doesn't support multidex
    targetSdkVersion 23

    // Enabling multidex support.
    multiDexEnabled true

}
dexOptions {
    jumboMode = true

    preDexLibraries = false
    javaMaxHeapSize "2048M"
}
sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }

    // Move the tests to tests/java, tests/res, etc...
    instrumentTest.setRoot('tests')

    // Move the build types to build-types/<type>
    // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
    // This moves them out of them default location under src/<type>/... which would
    // conflict with src/ being used by the main source set.
    // Adding new build types or product flavors should be accompanied
    // by a similar customization.
    debug.setRoot('build-types/debug')
    release.setRoot('build-types/release')
    }
    productFlavors {
    }
    buildTypes {
    debug {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}


dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.1'
}

dependencies {
 compile 'com.android.support:multidex:1.0.1'
}

1 Answers1

0

i think you are using more than one dependencies with same package name like compile 'com.google.android.gms:play-services:7.5.0' compile 'com.google.android.gms:play-services-wearable:7.5.0'

Satyavrat
  • 469
  • 1
  • 7
  • 24
  • iam using appcompat and multidex ..what should i do? – rajsharma shanmugam Sep 27 '15 at 09:05
  • rather using multi dex use `compile 'com.google.android.gms:play-services:7.5.0'` dependencies it will reduce number of method see on this page.[https://developers.google.com/android/guides/setup](https://developers.google.com/android/guides/setup) – Satyavrat Sep 27 '15 at 09:34