【问题标题】:Failed to crunch file - Gradle tasks failed处理文件失败 - Gradle 任务失败
【发布时间】:2017-05-12 01:49:03
【问题描述】:

我是使用 android studio 并在 android 上编程的新手,我收到此错误:

信息:Gradle 任务 [:app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources]

错误:压缩文件失败 C:\Users\alexa\Documents\Projectos\Blueprint Apocalypse\Mobile Application\Blueprint_App\MyApplication\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\24.2.1\res\drawable-xhdpi-v4\abc_list_selector_disabled_holo_light.9.png 进入 C:\Users\alexa\Documents\Projectos\Blueprint Apocalypse\Mobile Application\Blueprint_App\MyApplication\app\build\intermediates\res\merged\debug\drawable-xhdpi-v4\abc_list_selector_disabled_holo_light.9.png

错误:任务 ':app:mergeDebugResources' 执行失败。 错误:无法处理文件 C:\Users\alexa\Documents\Projectos\Blueprint Apocalypse\Mobile Application\Blueprint_App\MyApplication\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\24.2.1 \res\drawable-xhdpi-v4\abc_list_selector_disabled_holo_light.9.png 到 C:\Users\alexa\Documents\Projectos\Blueprint Apocalypse\Mobile Application\Blueprint_App\MyApplication\app\build\intermediates\res\merged\debug\drawable- xhdpi-v4\abc_list_selector_disabled_holo_light.9.png

我该如何解决这个问题?

【问题讨论】:

    标签: android android-studio


    【解决方案1】:

    不幸的是,这里的问题在于项目的路径

    请将其移至短路径,例如 - C:\Users\alexa\Documents\YourProject。

    我之前遇到过这个问题,在将项目位置移动到短路径后它就可以工作了。

    奇怪但我知道的唯一解决方法。

    【讨论】:

      【解决方案2】:

      清理项目。

      Build > Clean Project 
      

      另一个选项是在项目部分转到 build.gradle 并降级 gradle 版本

      dependencies {
          classpath 'com.android.tools.build:gradle:x.x.x'
      }
      

      【讨论】:

        猜你喜欢
        • 2019-11-12
        • 2020-11-10
        • 2021-05-24
        • 1970-01-01
        • 1970-01-01
        • 2019-12-24
        • 2021-10-28
        • 2021-08-07
        • 1970-01-01
        相关资源
        最近更新 更多