Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Error: org.gradle.process.internal.ExecException

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

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.

Appreciate the help.

like image 617
ctapp1 Avatar asked Mar 02 '15 23:03

ctapp1


2 Answers

Well I figured out the problem..

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".

Cheers

like image 70
ctapp1 Avatar answered Nov 16 '22 07:11

ctapp1


This can happen when gradle fails to process resources. In your case it happened to be an invalid image file in the drawable folder, in my case it was an error in one of my XML layouts that Android Studio didn't pick up on

like image 27
Rhys Davis Avatar answered Nov 16 '22 05:11

Rhys Davis