简体   繁体   English

当我用高清png图像替换低质量png图像时,在android中生成失败错误

[英]build failed error in android when I replace low quality png image with HD png image

I am new to android. 我是Android新手。 I am getting this strange error that I was using a low quality png image as background for startup screen but Now I got HD Image of the same and replaced that low quality image with HD image. 我收到一个奇怪的错误,我使用低质量的png图像作为启动屏幕的背景,但是现在我得到了相同质量的HD图像,并用HD图像替换了该低质量的图像。 But I am getting this strange build error. 但是我遇到了这个奇怪的构建错误。

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

Even if I dont use that image in any of the activities and I just place that image into my project folder like drawable it results in the above error. 即使我在任何活动中均不使用该图像,而只是将该图像像drawable一样放置到我的项目文件夹中,也会导致上述错误。

Try using the latest version of the build tools . 尝试使用最新版本的build tools you will get it from sdk manager. 您可以从SDK管理员那里获得。 Give it a try and let me know the progress. 试试看,让我知道进度。 You are facing similar problem like this . 你都面临着类似的问题像这样

If you are using images for setting background image in activity then it is recommended that image should be from drawable folder. 如果您使用图像在活动中设置背景图像,则建议该图像应来自drawable文件夹。 Mipmap is used only for Icons. Mipmap仅用于图标。 So try using it from drawables than mipmap . 因此,请尝试从可绘制对象而不是mipmap使用它。 I hope it helps. 希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM