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

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

问题描述

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

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

仅当项目保存在 C: 驱动器上时才会发生这种情况.如果我将它保存到其他驱动器,它可以完美运行.

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?

推荐答案

这是路径长度限制造成的.我认为最多 256 个字符.

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:如果项目是在驱动器 C 上创建的,则“任务 ':app:mergeDebugResources' 执行失败":的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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