Android 开发问题总结

  1. Execution failed for task ':mergeDebugResources'

     

    错误2:Execution failed for task ':mergeDebugResources'.
    > Error: Failed to run command:
            D:\soft_dev\android-sdk-windows\android-sdk-windows\build-tools\19.1.0\a
    apt.exe s -i E:\Aworkspace\NewWorkspace\VipOneToOneGradleTest\res\drawable-xhdpi
    \white.png -o E:\Aworkspace\NewWorkspace\VipOneToOneGradleTest\build\intermediat
    es\res\debug\drawable-xhdpi-v4\white.png
    Error Code:
            42
    Output:
            libpng error: Not a PNG file

    解决:这时候是不是感觉很迷茫,出错了对吧,下面就告诉你是怎么回事,怎么出错的。
    错误很简单却也很难发觉,原因就是在这张图片上,为什么是图片上呢,刚开始的时候你的图片是不是.jpg格式的,然而你把后缀名改成了.png的以为就可以了是吧,其实不是这样,你只是把格式改成了.png,其实它还是.jpg格式的。要将图片真正转换成.png格式的才行。随便找个图片转换工具就可以解决。

    注意:在存放图片时千万不要将格式为.jpg的图片改成.png格式,千万不要偷懒,一定要将格式转换成PNG格式的图片,否则编译将不通过。切记!!!!

  2.   Missing one of the key attributes 'action#name,category#name' on element
     intent-filter at AndroidManifest.xml:342:13
    Output:
            res\drawable-xhdpi-v4\white.png:0: error: Resource entry white is alread
    y defined.
            res\drawable-xhdpi-v4\white.jpg:0: Originally defined here.

    ce\NewWorkspace\Vi
     非法字符: \65279
    解决:
    由于java文件是已utf-8-bom的形式保存的,至于为何导致了这种情况,无需考究,通过editplus打开文件就可以看到。然后另存为utf-8形式就可以了。再将修改了编码的文件替换项目中报错的文件,错误就解决了

  3. FAILURE: Build failed with an exception.
    * What went wrong:Execution failed for task ':lint'.

    > Lint found errors in the project; aborting build.

    Fix the issues identified by lint, or add the following to your build script to proceed with errors:

android {

    lintOptions {

      abortOnError false

    }

}

解决:这种错误根据英文提示直接解决就可以了

 

 

转载于:https://my.oschina.net/u/1995545/blog/394661

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值