2017-07-03 42 views
0

使用android studio 2.3.3我堅持在Gradle Build Running。 我不知道和失去我的想法弄清楚我的項目發生了什麼。最近我們想編譯Zoom Login Application Sample,並仔細閱讀linkAndroid Studio 2.3.3卡在Gradle構建中運行

下面是Android的Studio版本:

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 

在事件日誌中,似乎級努力來完成這個任務

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

我試圖

  1. 設置Global Gradle SettingOffline Work通過follow這solution
  2. 沒有使用谷歌播放服務,像這樣solution建議。
  3. 不使用代理
  4. gradle.properties項目
  5. 添加org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8org.gradle.parallel=trueC:\Users\<username>\.gradle\gradle.properties加入這行org.gradle.daemon=trueorg.gradle.parallel=true

每個解決方案我試過,但沒有一個人工作。這是愚蠢而荒謬的,即使我離開那一晚,構建階段也不能完成。

這裏是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 
} 

這裏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:[email protected]' 
    compile project(':zoom-authentication-5.1.1') 
} 

試圖從gradlew命令行gradlew -d assembleDebug打造, 我得到這個日誌,也許可以幫助識別我的問題後:

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 

它停留在任務:app:compileDebugJavaWithJavac

我試圖在C:\Users\<username>\.gradle\caches刪除緩存,仍然掛在:app:compileDebugJavaWithJavac過程

我無法弄清楚。任何想法?我錯過了什麼? 謝謝。

+0

嘗試從命令行構建項目。如果它也掛起,請添加'-d'來查看它可能掛起的位置。如果你不能自己解釋,你可能會發布結果讓助手查看。 – Vampire

+0

@Vampire試圖從命令行構建。我已經更新了我的問題。似乎卡在進程':app:compileDebugJavaWithJavac'上。任何想法? – NPE

+0

嘗試刪除' /。gradle'。但我懷疑它會有幫助。沒有其他想法,對不起。 – Vampire

回答

0

這個工作對我來說:

CTRL + SHIFT + ESC - >流程 - >殺死的java.exe - >重建

相關問題