libpng error: Not a PNG file Error Showing In Android Studio
You should follow below steps.
Cut-paste the image on my desktop.
Opened it in an editor saved it as png. without renaming the file
name.Copy-pasted the
.png
image into the drawable folder.
You can use cruncherEnabled
.
Returns true if the PNGs should be crunched, false otherwise.
android
{
aaptOptions
{
cruncherEnabled = false
}
}
Hope this helps you.
Android Studio Error - libpng error: Not a PNG file
Well... it's not a PNG file! Or just possibly it's a PNG file but not a supported variant.
If you would like any more info then you will have to upload the file somewhere and then post a link. It's impossible to tell anything more without it.
EDIT: Now that you've uploaded the file, I can see that it's a JPEG! It has a .png
extension, but it's not a PNG file.
AAPT err: libpng error: Not a PNG file
At last, I resolved the issue with the help of this link refer link
Goto terminal and execute the below mentioned command to know the details about the issue
gradlew assembleDebug --info
It will show you the info about the issue or warning. In my project i have got some issues like, some files crunching failed issue.
Steps to resolve:
Install the ImageMagick tool download
To remove the iCCP chunk from the PNG image
Click down the "Shift" key and right click on the folder which is having images
Select "Open command window here" option
In the command terminal type
mogrify *.png
(e.g. D:\AndroidProjects{your_project_folder}\app\src\main\res\drawable-hdpi>mogrify *.png)
- Now go to your project terminal execute the command
gradlew assembleDebug --info
,Hope all your warnings and failed to convert issues are removed.
android AAPT: libpng error: Not a PNG file
Complete those steps and solve your problem:
1) Cut-paste the image on your desktop.
2) Opened it in an editor saved it as png. without renaming the file name.
3) Copy-pasted the .png image into the drawable folder.
AAPT err: libpng error: Not a PNG file
At last, I resolved the issue with the help of this link refer link
Goto terminal and execute the below mentioned command to know the details about the issue
gradlew assembleDebug --info
It will show you the info about the issue or warning. In my project i have got some issues like, some files crunching failed issue.
Steps to resolve:
Install the ImageMagick tool download
To remove the iCCP chunk from the PNG image
Click down the "Shift" key and right click on the folder which is having images
Select "Open command window here" option
In the command terminal type
mogrify *.png
(e.g. D:\AndroidProjects{your_project_folder}\app\src\main\res\drawable-hdpi>mogrify *.png)
- Now go to your project terminal execute the command
gradlew assembleDebug --info
,Hope all your warnings and failed to convert issues are removed.
Android studio How to resolve Error in png files of library added
Try to remove "builds" folders and do rebuild. But soon, the whole thing in a long file name. Read this answer. By the way, you looked logs? Maybe this is not the PNG? You have not sent the log and did not specify the version Gradle.
Believe me, iOS developers have own problems.
Related Topics
Android App Bundle with In-App Locale Change
How to Handle Outofmemoryerror
Android: Disable Soft Keyboard at All Edittexts
Android: Test Push Notification Online (Google Cloud Messaging)
Using Disklrucache in Android 4.0 Does Not Provide for Opencache Method
How to Set "Android:Layout_Below" at Runtime Programmatically
How to Draw Arc Between Two Points on the Canvas
Android: How to Create an "Ongoing" Notification
Android Webview Loading Data Performance Very Slow
Android Edittext Onchange Listener
Upload an Image from Camera or Gallery in Webview
Disable Default Animation from Portrait to Landscape
Android Studio Stuck on "Gradle: Resolve Dependencies '_Debugcompile'" or 'Detachedconfiguration1'
How to Get Activity's Content View
How to Create an Android Application in Android Studio That Uses the Google Maps API V2