Build Gradle Eterno

1

I did not find anything like it. When I try to run projects from a book it looks like this:

  

"Gradle: Resolve dependencies: 'app: _debugCompile'"

And it does not compile for anything. I changed my Gradle file to the versions I have.

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "br.com.exemplo.material"
    minSdkVersion 9
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'com.android.support:recyclerview-v7:23.1.1'
    compile 'com.android.support:palette-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
}

And still it is "compiling" straight and does not give error, is half locked. I do not know what to do.

Follow the image below.

    
asked by anonymous 21.01.2016 / 13:08

2 answers

1

mine was so in my case, it was an error in the xml file where I had a cardview I went to the File, Settings menu Build, Execution, Deployment > Build Tools > Gradle and enabled the option Offline work, gave a Clean Project and then Rebuild Project and he soon accused the error.

    
21.01.2016 / 20:58
0

I had the same problem, so I decided to help, to increase Gradle Build speed, modify your settings and scripts as follows:

1 - Click File > Settings > Gradle > and Modify as below:

  
  • SelecttheOfflineworkoptionandclickOK
  •   

2-ClickFile>Settings>Compiler>andModifyasbelow:

  
  • Selectthefouroptionsabove"Compile, Make, Sync, Configure" and put in Command-line Options: --offline and click OK
  •   

3 - Modify the following script build.grad (Module: app) - add dexOptions :

apply plugin: 'com.android.application'

    android {
       ...
        }

        dexOptions {
            javaMaxHeapSize "4g" //specify the heap size for the dex process
        }

        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:25.3.1'
        compile 'com.android.support:design:25.3.1'
        compile 'com.android.support:support-v4:25.3.1'
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
    }

Add this snippet:

    dexOptions {
                    javaMaxHeapSize "4g" //specify the heap size for the dex process
}

4 - Modify the following script gradle.properties (Project 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.

org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.daemon=true
org.gradle.parallel=true


# 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

Add this snippet:

org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.daemon=true
org.gradle.parallel=true

If you see a warning above, click on Try Again... or Sync Now , and see the result.

Tip: If your Android Studio is taking too long to start, I also recommend seeing this #

I hope I have helped. with me it worked, Gradle is faster.

    
19.05.2017 / 11:35