0

i am update my Android studio but that create a problem my gradle is taking long time for running project i search on google every solution doing but not solved my proble

my laptop cofig..

ram =6gp memory =1 tb window 7 64bit

my gradle is

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
    applicationId "com.vm.demo.myapp"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
dexOptions {
    incremental true
    javaMaxHeapSize "2g"
  }

 }
 dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.facebook.android:facebook-android-sdk:4.5.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:multidex:1.0.0'
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.google.android.gms:play-services-ads:9.0.2'
}

my gradle properties

# Project-wide Gradle settings.

   # IDE (e.g. Android Studio) users:
   # Gradle settings configured through the IDE *will override*
   # any settings specified in this file.

   # For more details on how to configure your build environment visit
   # http://www.gradle.org/docs/current/userguide/build_environment.html

   # Specifies the JVM arguments used for the daemon process.
   # The setting is particularly useful for tweaking memory settings.
   # Default value: -Xmx10248m -XX:MaxPermSize=256m
    org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

   # When configured, Gradle will run in incubating parallel mode.
   # This option should only be used with decoupled projects. More details, visit
   # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
   org.gradle.parallel=true
  • possibile duplicate of http://stackoverflow.com/questions/16775197/building-and-running-app-via-gradle-and-android-studio-is-slower-than-via-eclips – Vamsi Abbineni Jun 17 '16 at 11:32
  • Check a new feature instant-run, same [issue]( http://stackoverflow.com/questions/36623917/first-launch-take-long-time-in-android-studio-2-0-gradle-2-0/36625589#36625589) – Maxim G Jun 17 '16 at 11:34
  • @MaximG i enable instant-run –  Jun 17 '16 at 11:40
  • Did you try different configures https://developer.android.com/studio/run/index.html#set-up-ir? Try to disable this feature and test for a while. – Maxim G Jun 17 '16 at 12:01

1 Answers1

0

Try to add jumboMode true to your dex options.

dexOptions {
    jumboMode true
    incremental true
    javaMaxHeapSize "2g"
}
rdonuk
  • 3,921
  • 21
  • 39