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

解決:這種錯誤根據英文提示直接解決就能夠了

相關文章
相關標籤/搜索