Dimension "◇◇" in attribute "layout_width" is missing unit!

エラーエラー

問題発生

 状態:解決済  閲覧数:3,026  投稿日:2018-05-08  更新日:2018-05-08

エラーメッセージ


Dimension "◇◇" in attribute "layout_width" is missing unit!

エラー内容


「layout_width」に単位がありません!

解決方法


「layout_width」に単位を指定する





実際に遭遇した例

 閲覧数:542 投稿日:2018-05-08 更新日:2018-05-08

表示されたエラーメッセージ


Dimension "200" in attribute "layout_width" is missing unit!

エラー原因


Designプレビューで入力した値
200

▼layout/activity_main.xm
    <ImageView
android:id="@+id/imageView3"
android:layout_width="200"
android:layout_height="20p"
android:contentDescription="@string/img_txt_lion"
android:scaleType="matrix"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/lion" />


修正対応


単位を付与するよう、入力値を変更
200dp

▼layout/activity_main.xm
    <ImageView
android:id="@+id/imageView3"
android:layout_width="200dp"
android:layout_height="200dp"
android:contentDescription="@string/img_txt_lion"
android:scaleType="matrix"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/lion" />



R.java was modified manually! Reverting to generated version!



週間人気ページランキング / 3-3 → 3-9
順位 ページタイトル抜粋 アクセス数
1 Android FAQ 13
2 ★★ を型に解決できません | エラー(エラー) 4
3 Unexpected error while launching logcat | エラー(エラー) 3
3 R.java was modified manually! Reverting to generated version! | エラー(エラー) 3
4 [エラー] W/ResourceType(308): Failure getting entry for 0x7f030001 (t=2 e=1) in package 0: 0xffffffb5 | エラー(エラー) 2
4 Sorry! The application ★★ has stopped unexpectedly.Please try again. | エラー(エラー) 2
4 エラー対応 2
4 型 ○○親クラス名.△△ネストクラス名 は継承された抽象メソッド AsyncTask<第1引数,第2引数,第3引数>.doInBackground(Object...) を実装する必要があります | エラー(エラー) 2
5 Project build error: Non-resolvable parent POM: Failure to find | エラー 1
5 adb shell … error: device not found | Android Debug Bridge (adb) 1
5 インポートされた ★★ は見つかりません | エラー 1
5 ログイン 1
5 アプリをビルドして実行する | アプリ化(環境構築) 1
5 Project has no project.properties file! Edit the project properties to set one. | エラー(エラー) 1
5 Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties | エラー(エラー) 1
5 E/AudioPlayer(★★): FAILED renaming /mnt/sdcard/tmprecording.3gp to /android_asset/●●.mp3 | エラー 1
5 E/Trace(★★): error opening trace file: No such file or directory | エラー(エラー) 1
5 emulator-5554 disconnected! Cancelling | エラー(エラー) 1
5 この行に複数マーカーがあります | エラー(エラー) 1
5 The process android.process.acore has stopped unexpectedly. Please try again. | エラー(エラー) 1
2026/3/10 5:05 更新