【问题标题】:build failed error in android when I replace low quality png image with HD png image当我用高清 png 图像替换低质量 png 图像时,在 android 中构建失败错误
【发布时间】:2015-05-05 04:39:02
【问题描述】:

我是安卓新手。我收到了这个奇怪的错误,我使用低质量的 png 图像作为启动屏幕的背景,但现在我得到了相同的高清图像并用高清图像替换了那个低质量的图像。但是我遇到了这个奇怪的构建错误。

Error:Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Mubashir.gul\AppData\Local\Android\sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 42
Error:Execution failed for task ':app:mergeDebugResources'.
> C:\Users\Mubashir.gul\AndroidStudioProjects\Highrise\app\src\main\res\mipmap-mdpi\logo.png: Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Mubashir.gul\AppData\Local\Android\sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 42

即使我没有在任何活动中使用该图像并且我只是将该图像放入我的项目文件夹中,如可绘制,它也会导致上述错误。

【问题讨论】:

  • 不要使用高清图像..尝试使用另一个使用图像..请检查是否会再次升起相同的?
  • 它工作正常,但如果我使用低质量图像它会变得模糊
  • 然后使用9个补丁图像就可以解决你的图像模糊问题

标签: android compiler-errors android-gradle-plugin


【解决方案1】:

尝试使用最新版本的build tools。你会从 sdk manager 那里得到它。试一试,让我知道进度。 您面临类似this 的问题。

如果您在活动中使用图像设置背景图像,则建议图像应来自drawable 文件夹。 Mipmap 仅用于图标。所以尝试从drawables中使用它而不是mipmap。 希望对你有帮助。

【讨论】:

    猜你喜欢
    • 2012-05-27
    • 2012-07-05
    • 1970-01-01
    • 2015-12-18
    • 2023-02-08
    • 2013-01-16
    • 1970-01-01
    • 2019-02-28
    • 2016-11-27
    相关资源
    最近更新 更多