Android Studio:“执行任务失败”:app:mergeDebugResources'“如果项目在驱动器C上创建: [英] Android Studio: “Execution failed for task ':app:mergeDebugResources'” if project is created on drive C:

查看:140
本文介绍了Android Studio:“执行任务失败”:app:mergeDebugResources'“如果项目在驱动器C上创建:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在当前项目中添加了Google Play服务作为依赖项。
如果我将项目保存在C:驱动器上,
在同步项目时出现以下错误:

 错误:任务':app:mergeDebugResources'的执行失败。 
>错误:无法运行命令:
C:\程序文件(x86)\Android\android-studio\sdk\build-tools\android-4.4.2\aapt.exe s - I C:\Users\ashokp\Desktop\Studio\AndroidV2SDK_AndroidStudioFormat\Google播放
Services\SampleApplication\AndroidV2SDKSampleApp_GooglePlayServices\app\build\exploded-aar\com.google。 android.gms\play-services\4.3.23\res\drawable-hdpi\common_signin_btn_text_focus_light.9.png -o
C:\Users\ashokp\Desktop\Studio\ AndroidV2SDK_AndroidStudioFormat\Google播放
Services\SampleApplication\AndroidV2SDKSampleApp_GooglePlayServices\app\build\res\all\debug\drawable-hdpi\common_signin_btn_text_focus_light.9.png
错误代码:
42

只有当项目保存在C:驱动器上时才会发生这种情况。
如果我将它保存到其他驱动器,它完美的工作。



其他人是否面临这个问题?
这是什么原因造成的?
如何修正/规避此问题?


解决方案

这是由路径长度限制引起的。
我认为这是最多256个字符。



重新定位您的项目并且构建会成功。


I added Google Play services as a dependency in my current project. If I save the project on the C: drive, I get the following error while syncing up the project:

Error: Execution failed for task ':app:mergeDebugResources'.
       > Error: Failed to run command:
       C:\Program Files (x86)\Android\android-studio\sdk\build-tools\android-4.4.2\aapt.exe s -i C:\Users\ashokp\Desktop\Studio\AndroidV2SDK_AndroidStudioFormat\Google Play
       Services\SampleApplication\AndroidV2SDKSampleApp_GooglePlayServices\app\build\exploded-aar\com.google.android.gms\play-services\4.3.23\res\drawable-hdpi\common_signin_btn_text_focus_light.9.png -o
       C:\Users\ashokp\Desktop\Studio\AndroidV2SDK_AndroidStudioFormat\Google Play
       Services\SampleApplication\AndroidV2SDKSampleApp_GooglePlayServices\app\build\res\all\debug\drawable-hdpi\common_signin_btn_text_focus_light.9.png
       Error Code:
       42

This only happens if the project is saved on the C: drive. If I save it to some other drive, it works perfectly.

Does anyone else face this issue? What causes this? How can I fix/circumvent this?

解决方案

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

Relocate your project and the build will succeed.

这篇关于Android Studio:“执行任务失败”:app:mergeDebugResources'“如果项目在驱动器C上创建:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆