您的位置:首页 > 其它

studio报错显示png图片异常

2016-07-28 18:40 447 查看
今天日了狗了。

在进行eclipse转到studio的过程中发现出现了一下错误

 Information:Gradle tasks [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:compileDebugSources, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources]

Observed package id 'add-ons;addon-google_apis-google-23' in inconsistent location 'D:\sdk\add-ons\addon-google_apis-google-23-1' (Expected 'D:\sdk\add-ons\addon-google_apis-google-23')

:clean

:app:clean

:app:preBuild UP-TO-DATE

:app:preDebugBuild UP-TO-DATE

:app:checkDebugManifest

:app:preReleaseBuild UP-TO-DATE

:app:prepareComAndroidSupportAnimatedVectorDrawable2400Library

:app:prepareComAndroidSupportAppcompatV72400Library

:app:prepareComAndroidSupportSupportV42400Library

:app:prepareComAndroidSupportSupportVectorDrawable2400Library

:app:prepareDebugDependencies

:app:compileDebugAidl

:app:compileDebugRenderscript

:app:generateDebugBuildConfig

:app:mergeDebugShaders

:app:compileDebugShaders

:app:generateDebugAssets

:app:mergeDebugAssets

:app:generateDebugResValues UP-TO-DATE

:app:generateDebugResources

:app:mergeDebugResources

AAPT err(Facade for 2014483692): libpng error: Not a PNG file

Error:Execution failed for task ':app:mergeDebugResources'.

> Some file crunching failed, see logs for details

Information:BUILD FAILED

Information:Total time: 6.565 secs

Information:1 error

Information:0 warnings

Information:See complete output in console  

产生原因:

图片的格式不对,这个不对是自己的图片本来是jpg 的,但是我修改了后缀名为png ,。 在eclipse中没有报错,但是在studio中却显示为错误。 

解决办法:

删掉

我的做法:

新建studio项目,将原来eclipse项目中的所有图片放置到新建本地电脑文件夹中,然后通过二分法,快速定位到出错的那个图片。

为什么确定:

发现导入的那张图片拿出来 在ps中以png打开显示解析异常,修改后缀名为jpg的然后就可以正常打开。从而确定就是这张图片错误的原因就是修改了不是png的类型。

妈的 搞了一整天。我是不是傻!!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: