Android – Error 350 with layout_height (Android Studio)

androidandroid-layoutxml

I am getting this error when i try to build my application:

error: '350' is incompatible with attribute android:layout_height (attr) dimension|enum [fill_parent=4294967295, match_parent=4294967295, wrap_content=4294967294].
Message{kind=ERROR, text=error: '350' is incompatible with attribute android:layout_height (attr) dimension|enum [fill_parent=4294967295, match_parent=4294967295, wrap_content=4294967294]., sources=[C:\Users\chris\Documents\GitHub\IFB398\MiBaseApplication\app\src\main\res\layout\activity_login_screen.xml:30], original message=, tool name=Optional.of(AAPT)}

I am using Android studio and I am really new to all this.

EDIT 1:

<EditText
        android:id="@+id/UsernameEditText"
        android:layout_width="307dp"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:ems="10"
        android:hint="Username"
        android:inputType="textPersonName"
        android:textColor="@android:color/background_light"
        android:textColorHint="@android:color/darker_gray"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.513"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.55" />

    <ImageView
        android:id="@+id/LogoImageView"
        android:layout_width="350"
        android:layout_height="350"
        android:layout_marginBottom="6dp"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.0"
        app:srcCompat="@mipmap/mibaselogo" />

    <EditText
        android:id="@+id/PasswordEditText"
        android:layout_width="309dp"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:ems="10"
        android:hint="Password"
        android:inputType="textPassword"
        android:textColor="@android:color/background_light"
        android:textColorHint="@android:color/darker_gray"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.514"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/UsernameEditText"
        app:layout_constraintVertical_bias="0.085" />

I have not added all code. Just the section above and below the error. (I am assuming that the error was on line 30 which is the start of the image.

Best Answer

You need to specify dimension unit like dp or dip. For android:layout_height attribute use "350dp" instead of "350".

Hope this helps.