Android IDE (AIDE) Support Forum

Error in the xml editor

Hi,

I use the screen editor to built my app activity screens. And this has worked perfectly (appartement pickers) but it mainlevée worked. After few time I was wanting to add something extra, but unfortunately it does not work. I tried on both of the xml i have, but both are showing the same message:
Can not view the layout. Attempt to invoke interface method ’java.util.collection java.util.Map.Values() On a null object reference

May you upload some screenshots? Including logcat

Here it is

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
	android:orientation="vertical"
	android:layout_width="wrap_content"
	android:layout_height="wrap_content">

	<Button
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:text="Nouvelle Personne"
		android:onClick="onNewButtonClick"/>

	<ListView
		android:layout_width="250dp"
		android:layout_height="wrap_content"
		android:layout_marginLeft="10dp"
		android:layout_marginRight="10dp"
		android:id="@+id/sProfilList"/>

</LinearLayout>

<LinearLayout
	android:orientation="vertical"
	android:layout_width="match_parent"
	android:layout_height="wrap_content"
	android:layout_marginLeft="20dp">

	<TextView
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:text="Profile"
		android:textAppearance="?android:attr/textAppearanceLarge"
		android:textSize="30sp"
		android:textStyle="bold"
		android:typeface="serif"/>

	<TextView
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:text="@string/nom"
		android:textAppearance="?android:attr/textAppearanceLarge"
		android:width="120dp"
		android:alpha="1.0"
		android:textStyle="bold"
		android:layout_marginLeft="20dp"/>

	<EditText
		android:id="@+id/sName"
		android:layout_width="match_parent"
		android:inputType="textPersonName"
		android:layout_height="wrap_content"
		android:ems="10"
		android:layout_marginLeft="20dp"/>

	<TextView
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:text="@string/prenom"
		android:width="120dp"
		android:textAppearance="?android:attr/textAppearanceLarge"
		android:layout_marginLeft="20dp"
		android:textStyle="bold"/>

	<EditText
		android:id="@+id/sFirstname"
		android:layout_width="match_parent"
		android:inputType="textPersonName"
		android:layout_height="wrap_content"
		android:ems="10"
		android:layout_marginLeft="20dp"/>

	<TextView
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:text="@string/DateNaissance"
		android:width="120dp"
		android:textAppearance="?android:attr/textAppearanceLarge"
		android:gravity="left"
		android:textStyle="bold"
		android:layout_marginLeft="20dp"/>

	<LinearLayout
		android:orientation="horizontal"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_marginLeft="20dp">

		<NumberPicker
			android:id="@+id/sDay"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"/>

		<NumberPicker
			android:id="@+id/sMonth"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"/>

		<NumberPicker
			android:id="@+id/sYear"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"/>

	</LinearLayout>

	<LinearLayout
		android:orientation="horizontal"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content">

		<RadioButton
			android:id="@+id/sMain"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:text="principal"
			android:layout_marginLeft="20dp"/>

	</LinearLayout>

	<Button
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:text="Enregister"
		android:id="@+id/SaveButton"
		android:onClick="onSaveButtonClick"/>

</LinearLayout>

<Button
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	android:text="Button"/>

But this happening in the aide editor, when i click on the small top right icon looking like small screen or picture, not at exécution. It works perfectly while executing.
Issue i have now is that i cannot update screens.

You mean the UI designer is not working…
Copied your code and it didn’t work, but I don’t know if you provided me the full xml content, cause I had to sorround it with a main linear layout and added the following tag xmlns:android=“http://schemas.android.com/apk/res/android
Now it works, bit if after this doesn’t work for you it means it’s a bug in AIDE.

Here the code, give it a try





<LinearLayout
	android:orientation="vertical"
	android:layout_width="match_parent"
	android:layout_height="wrap_content"
	android:layout_marginLeft="20dp">
	<TextView
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:text="Profile"
		android:textAppearance="?android:attr/textAppearanceLarge"
		android:textSize="30sp"
		android:textStyle="bold"
		android:typeface="serif"/>
	<TextView
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:text="@string/nom"
		android:textAppearance="?android:attr/textAppearanceLarge"
		android:width="120dp"
		android:alpha="1.0"
		android:textStyle="bold"
		android:layout_marginLeft="20dp"/>
	<EditText
		android:id="@+id/sName"
		android:layout_width="match_parent"
		android:inputType="textPersonName"
		android:layout_height="wrap_content"
		android:ems="10"
		android:layout_marginLeft="20dp"/>
	<TextView
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:text="@string/prenom"
		android:width="120dp"
		android:textAppearance="?android:attr/textAppearanceLarge"
		android:layout_marginLeft="20dp"
		android:textStyle="bold"/>
	<EditText
		android:id="@+id/sFirstname"
		android:layout_width="match_parent"
		android:inputType="textPersonName"
		android:layout_height="wrap_content"
		android:ems="10"
		android:layout_marginLeft="20dp"/>
	<TextView
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:text="@string/DateNaissance"
		android:width="120dp"
		android:textAppearance="?android:attr/textAppearanceLarge"
		android:gravity="left"
		android:textStyle="bold"
		android:layout_marginLeft="20dp"/>
	<LinearLayout
		android:orientation="horizontal"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_marginLeft="20dp">
		<NumberPicker
			android:id="@+id/sDay"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"/>
		<NumberPicker
			android:id="@+id/sMonth"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"/>
		<NumberPicker
			android:id="@+id/sYear"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"/>
	</LinearLayout>
	<LinearLayout
		android:orientation="horizontal"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content">
		<RadioButton
			android:id="@+id/sMain"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:text="principal"
			android:layout_marginLeft="20dp"/>
	</LinearLayout>
	<Button
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:text="Enregister"
		android:id="@+id/SaveButton"
		android:onClick="onSaveButtonClick"/>
</LinearLayout>

<Button
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	android:text="Button"/>

1 Like