任务':mergeDebugResources'的执行失败。这是什么&怎么解决?

时间:2014-12-10 22:04:54

标签: android build.gradle

当我尝试运行该项目时,它显示了此错误。

这些名字都有效,但这个错误仍然让我感到恼火

以下是错误:

Error:Execution failed for task ':mergeDebugResources'.
> /Users/hammadnasir/AndroidstudioProjects/DuaThePowerfulWeapon/res/drawable-hdpi/dua_when_leaving_mosque.JPG: Error: Invalid file name: must contain only lowercase letters and digits ([a-z0-9_.])

以下是我的build.gradle文件:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.2'
    }
}

allprojects {
    repositories {
        mavenCentral()
    }
}

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

我尝试了很多关于此问题的搜索,但我仍然无法解决此错误!

请帮助我!

所有帮助都将受到高度赞赏。

提前致谢。

1 个答案:

答案 0 :(得分:1)

错误消息表明:

... / res / drawable-hdpi / dua_when_leaving_mosque.JPG:错误:文件名无效:必须只包含小写字母和数字([a-z0-9 _。])

指示的文件名称为大写字母( .JPG )。

将文件从dua_when_leaving_mosque.JPG重命名为dua_when_leaving_mosque.jpg