Matas Vaitkevicius Matas Vaitkevicius - 1 year ago 129
Android Question

Xamarin Main.xml is missing from assets then Layout contains malformed xml - Root element is missing

I am starting out with Xamarin studio, I have build most basic forms project. In tutorials it shows how to edit layout in

, that is supposed to be in
that is missing in my solution. So when I add it manually it then fails with error message
The layout contains malformed XML
and another one
Root element is missing
. When I opened the
in notepad I can see contents to be
<?xml version="1.0" encoding="UTF-8" ?>

enter image description here

How do contents of proper blank Main.xml supposed to be like?

Answer Source

Figured it out myself

Click on source, then add

<LinearLayout xmlns:android="" android:layout_width="fill_parent" android:layout_height="fill_parent">

and that should do it.

enter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download