Android 開發問題總結

來源:互聯網
上載者:User

標籤:

  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

    }

}

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

 

 

Android 開發問題總結

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.