Android Studio 错误:org.gradle.process.internal.ExecException [英] Android Studio Error: org.gradle.process.internal.ExecException

查看:23
本文介绍了Android Studio 错误:org.gradle.process.internal.ExecException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 android 开发的新手,遇到了我的第一个错误,似乎无法绕过它.我已经在我的 mac 上下载并安装了 android studio 和 java,并制作了一个虚拟应用程序只是为了看到它在模拟器中运行.默认的 hello world 应用程序运行良好,但是一旦我将 .png 文件添加到我的可绘制文件夹中,我就会收到此错误:

I am new to android development and have hit my first error and can't seem to get around it. I have downloaded and installed android studio and java on my mac and a made a dummy app just to see it run in the simulator. The default hello world app runs fine but as soon as I add a .png file to my drawable folder, I get this error:

Error:Error: com.android.ide.common.process.ProcessException:    org.gradle.process.internal.ExecException: Process 'command '/Users/billy/Library/Android/sdk/build-tools/21.1.2/aapt'' finished with non-zero exit value 42

我想说的是,我只看到一个 drawable 文件夹,而不是我在许多教程中看到的普通 drawable-hdpi、mdpi 等.

I few things to mention are that I only see one drawable folder, not the normal drawable-hdpi,mdpi, etc that I see in many tutorials.

感谢您的帮助.

推荐答案

好吧,我找到了问题所在..

Well I figured out the problem..

一旦我将 .png 改回其原始的 .jpeg 扩展名,我的应用程序就运行良好.我猜 AS 在更改图像文件的扩展名时很挑剔.奇怪的是,当我将其更改为 .png 然后查看其信息时,它说它确实是一个便携式网络图形,所以这就是我感到困惑的原因.如果有人能对这里发生的事情有所了解,那就太好了.我认为图像文件一直是 .jpeg,这就是为什么它给我不是 PNG".

Once I changed the .png back to a its original .jpeg extension my app ran fine. I guess AS is picky when changing the extension to the image files. Odd though when I changed it to .png and then viewed its info, it said it was indeed a portable network graphic so that is why I was confused. If someone could shed some light on what is going on here that would be great. I think the image file was a .jpeg all along that is why it was giving me "Not a PNG".

干杯

这篇关于Android Studio 错误:org.gradle.process.internal.ExecException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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