【发布时间】:2016-08-03 04:28:13
【问题描述】:
每当我运行、制作或清理项目时,
Error:Execution failed for task ':app:mergeDebugResources'.> -1
这个错误信息出来了。
我已多次检查我的资源文件,没有出现致命错误。 只有png图标和xml文件。
我不知道'-1'是什么意思..
在我的主要 java 文件中,有“无法解析符号 R”的错误。
我的应用程序昨晚启动良好,但是当我今天早上醒来并运行 android studio 时,它失败了。
我该怎么办?
这是我的毕业作品
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.exapmle.rantalk"
minSdkVersion 21
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.android.support:support-v13:24.1.1'}
在下面,我添加了我的整个 gradle 输出,谢谢。
执行任务:[:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:compileDebugSources, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources]
按需配置是一项孵化功能。 增量java编译是一个孵化特性。 :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAnimatedVectorDrawable2411Library UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72411Library UP-TO-DATE :app:prepareComAndroidSupportCardviewV72411Library UP-TO-DATE :app:prepareComAndroidSupportDesign2411Library UP-TO-DATE :app:prepareComAndroidSupportRecyclerviewV72411Library UP-TO-DATE :app:prepareComAndroidSupportSupportV132411Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42411Library UP-TO-DATE :app:prepareComAndroidSupportSupportVectorDrawable2411Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl 最新 :app:compileDebugRenderscript 最新 :app:generateDebugBuildConfig 最新 :app:mergeDebugShaders 最新 :app:compileDebugShaders 最新 :app:generateDebugAssets 最新 :app:mergeDebugAssets 最新 :app:generateDebugResValues 最新 :app:generateDebugResources 最新 :app:mergeDebugResources 失败
FAILURE:构建失败并出现异常。
-
出了什么问题: 任务 ':app:mergeDebugResources' 执行失败。
-1
尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。
构建失败
总时间:7.62 秒
【问题讨论】:
-
尝试通过以下方式清理 android studio:点击 File 选择 Invalidates Cache/Restart 然后选择 Invalidates cache and Restart。
-
您能否展示更多 Gradle 输出?
-
@cricket_007 我已将其添加到我的帖子中,谢谢。
-
@sonnv1368 我尝试了很多次..但它没有工作。
-
抱歉,没有回复这个。你可以试试
Run with --info or --debug option to get more log output
标签: android android-gradle-plugin