【发布时间】:2017-03-19 15:21:03
【问题描述】:
我刚刚安装了新的 Android Studio 并尝试创建一个新项目。但我得到了这个奇怪的错误。我使用的是 32 位 Linux 系统。
错误:任务 ':app:mergeDebugResources' 执行失败。
错误:java.util.concurrent.ExecutionException:java.lang.RuntimeException:AAPT 进程未准备好接收命令 信息:构建失败
错误:java.util.concurrent.ExecutionException:java.lang.RuntimeException:AAPT 进程未准备好接收命令
信息:总时间:14.838 秒
信息:2 个错误
信息:0 个警告 信息:在控制台中查看完整的输出
我不明白为什么会收到此错误。
分级
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.sandesh.testing"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
Gradle(项目)
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()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
【问题讨论】:
-
请提供gradle文件
-
@JaydeepPatel,添加请检查
-
主项目gradle文件或版本?
-
升级到 2.3.0 就可以了。比如:类路径'com.android.tools.build:gradle:2.3.0'
-
@JaydeepPatel,已经是
classpath 'com.android.tools.build:gradle:2.3.0'
标签: java android android-studio