Android(アンドロイド)Eclipseエラー&警告対応
エラー
Incorrect line ending: found carriage return (\r) without corresponding newline (\n)
レイアウトのxml画面で「Ctrl + Shift + F」を押してから保存すればOK。
エラー
Failed to load the LayoutLib: com.android.layoutlib.bridge.Bridge$PostInflateException
クリーンしてEclipseを再起動すればOK。
コンパイルエラー
Your project contains error(s),please fix them begore running your application
クリーンしてEclipseを再起動すればOK。
Eclipse起動時にクリーン(cleanコマンド)を実行する方法
C:\eclipse\eclipse.exe -clean
アイコンを右クリックし「プロパティ>ショートカット(タブ)>リンク先」を上記のように変更してから実行。
エラー
Failure 5 (database is locked) on 0x[6桁の16進数] when executing 'BEGIN EXCLUSIVE;'
同一メソッドでの書き込み処理が衝突しないように修正すればOK。
Lintエラーチェック
is not translated in
Export aborted because fatal lint errors were found.
string.xmlを各国語用にも作ってよというエラー。Lintのエラーチェックを緩めればOK。
エラー
NotFoundException: null Exception details are logged in Window > Show View > Error Log The following classes could not be found: - TextView (Change to android.widget.TextView, Fix Build Path, Edit XML)
グラフィカルレイアウトのAPIバージョンを(古いバージョンに)下げればOK。
警告
This ScrollView layout or its LinearLayout parent is possibly useless
このスクロールViewか親のViewが無駄。消すべき。
警告
This LinearLayout layout or its LinearLayout parent is useless
無駄に何度もLinearLayoutで括ってる。無駄を省けばOK。
警告
Use a layout_height of 0dip instead of wrap_content for better performance
"wrap_content"ではなく、"0dip"にすればOK。
警告
Missing contentDescription attribute on image
画像が表示できない場合の代わりの文字列を定義してないと出る。
android:contentDescription="@string/desc"
上記のようにstring.xmlに定義または直接記入すればOK。
メモリ不足警告
Unable to execute dex: Java heap space Java heap space
eclipse.iniの一番下の数値を増やせばOK(512mから1024mなどにする)