Android Studio: "Execution Failed for Task ':App:Mergedebugresources'" If Project Is Created on Drive C:

Android Studio: “Execution failed for task ':app:mergeDebugResources'” if project is created on drive C:

This is caused by the path length restriction.
I think it's 256 characters maximum.

Relocate your project and the build will succeed.

Unable to build Android APK - Execution failed for task ':app:mergeDebugResources'

Run following command from Android studio terminal/ubuntu machine shell.

gradlew clean
gradlew assembleDebug --debug

Android studio error: app:mergeDebugResources

This is 2 probability that makes the error:

  1. Maximum 260 characters for the file path. Here the excerpt from the Windows Naming Files, Paths, and Namespaces documentation:

Maximum Path Length Limitation

In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\some 256-character path string" where "" represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)


  1. Your username is using some special unicode instead of ascii, something like userñame

Execution failed for task ':app:mergeDebugResources' when building project on Jenkins

Run following commands from your jenkins terminal.

    gradlew clean
gradle assembleDebug

If above command does not work, then delete gradle folder.

    rm -rf C:\Windows\System32\config\systemprofile\.gradle

and then build using command

    gradle assembleDebug


Related Topics



Leave a reply



Submit