stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
11/01/15 11:19 AM (9 years ago)

Error with png in Android Studio

Trying to upgrade an app to Android and I guess since the last time I tried, we now have to use Android Studio. OK, downloaded everything and all worked pretty well but then I added my png's to the drawable folder and now the app gives me an error, concerning the png called ssaturn.png. Can anybody give me an idea what might be wrong with this png especially since I have a feeling, once I fix this one, there will be other errors popping up regarding the other pngs? Thanks. Error:Execution failed for task ':app:mergeDebugResources'. > /Users/skronwith/Desktop/skyeventfinder-for-Android-Studio/app/src/main/res/drawable/ssaturn.png: Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/skronwith/Desktop/adt-bundle-mac-x86_64-20140702-2/sdk/build-tools/21.1.2/aapt'' finished with non-zero exit value 42
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
11/01/15 03:38 PM (9 years ago)
Hi Steve, I was helping another use out once, and she had tons of errors related to PNG's. I couldn't figure out what the deal was until I decided to check and see if there was an issue with the file. Sure enough, after I ran them through a checker, it turns out none of the were valid PNG files. And we had the same problem until we did the check...fixed one, and the next file would pop up as bad. She had 200+ files! So, my first recommendation would be to run them through a PNG validator. If you do a Google search for 'png validator,' many results will be returned. I used pngcheck, and that worked like a charm. Hopefully this was the problem and it's all good now! Mark
 
stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
like
11/01/15 03:51 PM (9 years ago)
Thanks Mark, I'll try that though the same png files work fine in my IOS version of the app. Steve
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
11/01/15 03:52 PM (9 years ago)
It's always worth checking...Android seems to be much more particular than iOS. Mark
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/01/15 04:22 PM (9 years ago)
I second Marks comment. Some things, things that work on iOS do not similarly work on Android. Cheers! -- Smug
 
NicoRacing
Lost but trying
Profile
Posts: 78
Reg: Oct 25, 2013
Hyeres
3,680
like
11/02/15 12:36 AM (9 years ago)
It happened to me that an image with the extension .PNG in capital letters (which doesn't make any difference for Paint or other visual softwares) was not recognized under A-Studio, whereas the same file renamed with the extension .png in small letters worked. Nico
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/02/15 04:17 AM (9 years ago)
Seriously? Now *that* is picky. Glad you got it sussed out. Cheers! -- Smug
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.