gpt4 book ai didi

Android错误运行应用程序

转载 作者:行者123 更新时间:2023-11-30 02:03:49 25 4
gpt4 key购买 nike

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

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

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Jim\AppData\Local\Android\sdk\build-tools\22.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\22.0.1\aapt.exe'' finished with non-zero exit value 1
  • 尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。

构建失败

总时间:5.219 秒

我使用 Android Studio。这是我的 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 文件或任何代码无关。

关于Android错误运行应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31059995/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com