【发布时间】:2016-01-17 02:29:07
【问题描述】:
我在this guide.之后创建了一个基本的Android项目
现在,当我在命令行中运行 gradle(2.10 版)时,出现以下错误:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/opt/android-sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 1
这是我的 build.gradle 文件:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
}
这是我的 AndroidManifest.xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.hello"
android:versionCode="1"
android:versionName="1.0.0" >
<application android:label="@string/app_name" >
<activity
android:name=".HelloActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
有趣的是,当我启动 Android Studio(1.5) 并在那里构建一个测试应用程序时,它可以正常工作,但是在命令行中执行它会失败。我尝试从 AS 复制 gradle 文件,但无济于事。我检查了安装路径,应该是aapt。
我在这里很迷茫,因为几个月前我使用了上面的相同指南。今天我更新了我的 Android SDK 安装(编辑:我确保安装了正确的修订版)但我无法正确构建任何东西。
如果您需要更多信息,请告诉我,我卡住了。
【问题讨论】:
-
你能显示你的命令行吗?