Android 开发问题总结

  1. Execution failed for task ':mergeDebugResources' java

     

    错误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格式的图片,不然编译将不经过。切记!!!!android

  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形式就能够了。再将修改了编码的文件替换项目中报错的文件,错误就解决了web

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

    > Lint found errors in the project; aborting build.ide

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

android {

    lintOptions {ui

      abortOnError false编码

    }spa

}debug

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

相关文章
相关标签/搜索