[Android] Unparsed aapt error(s)! Check the console for output

來源:互聯網
上載者:User

在Eclipse平台進行Android 應用開發時,編輯,修改或增刪 res/下資源檔時有時會遇到如下錯誤提示:“Unparsed aapt error(s)! Check the console for output",因為它沒有描述錯誤在什麼地方,我不知道如何修正,於是百度找找,其中不少的文章都說:

  ”可檢查控制台輸出的提示來解決。

   比如在res/layout下新加了一個xml檔案: NewScreen.xml, 這時就會遇到上述錯誤提示, 控制台會有類似如下提示:

       the layout file name can only contain characters in [a- z0-9] etc.

   即layout 檔案名稱只能在小寫26個字母和數字0~9中選取. 因此,我們的檔案名稱中有大寫字母就會報錯.

   有時如果錯誤提示不清楚, 可以把R.java刪掉使其重建. 可以不直接刪, 把res下的某個檔案刪去(先備份一下), R.java即會重新更新.“

   我嘗試多次去重新命名剛才新增加的xml檔案,甚至刪除R.java檔案,還是無濟於事!後來看到了另一個方法:

   ”但是你的控制台上找不到錯誤或者 看不懂錯誤的時候的一招。

   例:出現

[2010-03-29 10:02:47 - Sudoku] W/ResourceType( 3540): Bad XML block: header size 62 or total size 26129448 is larger than data size 0

[2010-03-29 10:02:47 - Sudoku] E:\workspace\Sudoku\res\menu\menu.xml:2: ERROR Error parsing XML: no element found

[2010-03-29 10:04:55 - Sudoku] W/ResourceType( 4892): Bad XML block: header size 62 or total size 0 is larger than data size 0

以上錯誤的時候, 點 Project--------->clean.. 就會沒問題 “

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.