带有构建工具的aapt.exe问题23.0.2:线程“png-cruncher_3”中的异常java.lang.RuntimeException

时间:2015-11-26 14:11:38

标签: android android-studio android-gradle

我使用Android Studio创建了一个简单的项目,但构建过程没有完成......

我的项目配置:

APP build.gradle

apply plugin: 'com.android.application'
apply plugin: 'android-apt'

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        // replace with the current version of the Android plugin
        classpath 'com.android.tools.build:gradle:1.5.0'
        // replace with the current version of the android-apt plugin
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        //Gradle Daemon Support for Faster Compilation
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:0.12.1230'
    }
}

repositories {
    mavenCentral()
    mavenLocal()
}

def AAVersion = '3.3.2'

dependencies {
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
}

apt {
    arguments {
        androidManifestFile variant.outputs[0]?.processResources?.manifestFile
    }
}

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "br.com.myapp"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
    mavenLocal()
    maven {
        url "https://mint.splunk.com/gradle/"
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'

    // rastreamento de crashes do sistema
    compile 'com.splunk.mint:mint:4.4.0'

    //Retrofit
    compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'

    // Trabalhar com datas
    compile 'joda-time:joda-time:2.3'

    //Socket.IO-client
    compile 'io.socket:socket.io-client:0.6.2'

    //MATERIAL EDITTEXT
    compile 'com.rengwuxian.materialedittext:library:2.1.4'
}

gradle-wrapper.properties

#Wed Oct 21 11:34:03 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip

AS上的配置

我知道我没有使用推荐的版本,但它没有区别,因为Android Studio使用相同版本的文件gradle-wrapper

enter image description here

问题

enter image description here

没完成!

在这种情况下,我能做些什么吗?

修改

我注意到了这一点:

Exception in thread "png-cruncher_3" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at C:\Android\sdk\build-tools\23.0.2\aapt.exe can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)

aapt背景下的许多过程:

enter image description here

1 个答案:

答案 0 :(得分:1)

Windows中有两种可能的解决方案:
第一次检查你的局部变量必须有SLAVE_AAPT_TIMEOUT = 30 和JAVA_HOME = C:\ Program Files \ Java \ jdk1.8.0_65

如果这不起作用,那么你必须将sdk损坏,将其删除。安装路径和C:user \ username \ delete .android,.gradle,以及任何与Android Studio有关的文件夹,避免任何可能产生错误的缓存,然后重新下载应该工作的sdk