Android 错误 运行 应用程序

Android Error Running App

在我测试一个项目之前,一切都很好。但是,当我点击 运行 按钮时,出现错误:

错误:任务“:app:processDebugResources”执行失败。

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Jim\AppData\Local\Android\sdk\build-tools.0.1\aapt.exe'' finished with non-zero exit value 1

在控制台中,我得到这个:

正在执行任务:[:app:generateDebugSources, :app:generateDebugAndroidTestSources]

Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72220Library
:app:prepareComAndroidSupportSupportV42220Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:generateDebugResValues
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources

BUILD SUCCESSFUL

Total time: 17.327 secs
Executing tasks: [:app:assembleDebug]

Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42220Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
AGPBI: {"kind":"SIMPLE","text":"res\drawable-mdpi-v4\private.png:0: error:     invalid symbol: \u0027private\u0027","position":{},"original":"res\drawable-    mdpi-v4\private.png:0: error: invalid symbol: \u0027private\u0027"}


FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException:         org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Jim\AppData\Local\Android\sdk\build-tools.0.1\aapt.exe'' finished with non-zero exit value 1

构建失败

总时间:5.219 秒

我用Android Studio.This是我的gradle文件:

apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "com.example.bob.app"
    minSdkVersion 15
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
}

然后,当我使用 R 时,出现错误:无法解析符号 R

但我只是使用 setContentView(R.layout.activity_main);

如何解决这个错误?

事实证明,我的图像实际上不起作用。我删除了图像和程序运行。

AGPBI: {"kind":"SIMPLE","text":"res\drawable-mdpi-v4\private.png:0: error:     invalid symbol: \u0027private\u0027","position":{},"original":"res\drawable-    mdpi-v4\private.png:0: error: invalid symbol: \u0027private\u0027"}

private.png 是一张图片。它与我的 gradle 文件或任何代码无关。