2

I'm designing a form using a table layout, but the compiler is complaining that a number of attributes are either not defined or not allowed. Here's a snippet of the layout:

<GridLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/gridLayout1"
    android:columnCount="2"
    android:rowCount="2">
    <LinearLayout
        android:orientation="vertical"
        android:minWidth="25px"
        android:minHeight="25px"
        android:id="@+id/player1Layout"
        android:layout_column="0"
        android:layout_row="0"
        android:background="@android:color/holo_green_dark"
        android:layout_gravity="fill"
        android:layout_columnWeight="1"
        android:layout_rowWeight="1"
        android:layout_margin="1" />

When I compile, I get both warnings and errors related to the layout_* attributes. For the moment, I've set all three API levels (compile, target, and minimum) 26, which I'm pretty sure has all of these attributes, but I get the following errors:

error APT0000: 1: error: Error: Integer types not allowed (at 'layout_margin' with value '1').
error APT0000: 1: error: Error: Integer types not allowed (at 'layout_margin' with value '1').
error APT0000: 1: error: Error: Integer types not allowed (at 'layout_margin' with value '1').
error APT0000: 1: error: Error: Integer types not allowed (at 'layout_margin' with value '1').

The 'http://schemas.android.com/apk/res/android:layout_column' attribute is not declared.
The 'http://schemas.android.com/apk/res/android:layout_row' attribute is not declared.
The 'http://schemas.android.com/apk/res/android:layout_columnWeight' attribute is not declared.
The 'http://schemas.android.com/apk/res/android:layout_rowWeight' attribute is not declared.
1
  • your error for for the 'layout_margin' is Integer types not allowed, Yes it allows density-independent points.... something like this android:layout_marginRight="1dp" Commented Dec 20, 2017 at 3:54

1 Answer 1

1

Error APT0000: 1: error: Error: Integer types not allowed (at 'layout_margin' with value '1').

Use dp units, i.e.:

android:layout_margin="1dp"
Sign up to request clarification or add additional context in comments.

1 Comment

huh. odd; I set it through the designer UI and it correctly updated the WYSIWYG rendering.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.