Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
290 views
in Technique[技术] by (71.8m points)

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...