0

Using android studio 2.3.3 I've stuck on Gradle Build Running. I don't have any idea and loss my mind to figure it out what happened with my project. Recently we want to compile Zoom Login Application Sample and following carefully from this link.

Here are Android Studio Version :

Android Studio 2.3.3
Build #AI-162.4069837, built on June 6, 2017
JRE: 1.8.0_31-b13 x86
JVM: Java HotSpot(TM) Server VM by Oracle Corporation

On event log, Grade seems working hard to finish this task

Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]

I've tried to

  1. Set Global Gradle Setting to Offline Work by followed this solution
  2. Isn't using google play service like this solution suggest.
  3. Not using proxy
  4. Add org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 and org.gradle.parallel=true on gradle.properties project
  5. On C:\Users\<username>\.gradle\gradle.properties add this line org.gradle.daemon=true and org.gradle.parallel=true

Every solution I tried but no one work well. This is silly and ridiculous, the build phase cannot be completed even I leave that for one night.

Here is project build.gradle :

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()

        maven {
            url 'https://maven.facialnetwork.com/maven2'
            credentials {
                username '***'
                password '***'
            }
            authentication {
                basic(BasicAuthentication)
            }
        }

        // Reference local .aar file if it doesn't exist in maven
        flatDir{ dirs '../../../' }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

and here module build.gradle

buildscript {

}
apply plugin: 'com.android.application'

android {
    if (project.hasProperty("zoom_keystore")) {
        signingConfigs {
            release {
                storeFile file(zoom_keystore)
                storePassword zoom_keystore_password
                keyAlias zoom_key_alias
                keyPassword zoom_key_password
            }
        }
    }

    compileSdkVersion 25
    buildToolsVersion '25.0.3'
    defaultConfig {
        applicationId "com.facetec.zoom.sampleapp"
        minSdkVersion 18
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        buildConfigField("String", "ZOOM_APP_TOKEN", System.getProperty("zoom_app_token", "\"\""))
        resConfigs "en"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            if (signingConfigs.hasProperty('release')) {
                signingConfig signingConfigs.release
            }
        }
        debug {
            debuggable true
            jniDebuggable true
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:25.+'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.facetec:zoom-authentication:5.1.1@aar'
    compile project(':zoom-authentication-5.1.1')
}

after trying to build from gradlew command line gradlew -d assembleDebug, I got this log, maybe can help identify my problem :

09:08:19.942 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock
acquired.
09:08:19.942 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Relea
sing lock on daemon addresses registry.
> Building 62% > :app:compileDebugJavaWithJavac

Its stuck on task :app:compileDebugJavaWithJavac

I've tried to delete caches on C:\Users\<username>\.gradle\caches and still hang on :app:compileDebugJavaWithJavac process

I cannot figure it out. Any Idea? What I miss out? Thanks.

Yohanim
  • 3,319
  • 9
  • 52
  • 92
  • Try to build your project from the commandline. If it also hangs, add `-d` to see exactly what's going on where it is probably hanging. If you cannot interpret it yourself, you might post the result for helpers to review. – Vampire Jul 03 '17 at 11:26
  • @Vampire Have tried to build from command line. I've updated my question. Seems it stuck on process `:app:compileDebugJavaWithJavac`. Any idea? – Yohanim Jul 04 '17 at 02:10
  • Try deleting `/.gradle`. But I doubt it will help. No other ideas, sorry. – Vampire Jul 04 '17 at 06:47

2 Answers2

0

This works for me:

CTRL + SHIFT + ESC -> Process -> Kill java.exe -> Rebuild

quad
  • 872
  • 3
  • 17
  • 37
0

I also face this problem.

and i m really tired because i continuously 3 days find this solution.

then i show in gradle console. in which it show error: C:\Users\khimsuriya\AppData\Local\Android\sdk\build-tools\29.0.3-> "aapt" does not start.

so i change "build tool version" to 26.0.3 and the error was finished.

so you try change "build tool version" in your build.gradle(app level). it continue still you find perfect "strong textbuild tool version"

it is 100% work.

My number .9725414329