App crashed when I add controls

Benjamin Blanco 96 Reputation points
2021-05-06T04:20:39.01+00:00

My native Xamarin WebView app works fine until I add a button or progressbar. If I uncomment one of the controls in the code below the app crashed upon startup. What am I doing wrong?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!--
    <Button
        android:layout_weight="34" 
        android:layout_width="0dip"
        android:layout_height="wrap_content" 
        android:orientation="vertical"
        android:text="Home"
        android:id="@+id/btnHome" />
    -->

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/relativeLayout1">
        <!--<ProgressBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:visibility="invisible"
            android:id="@+id/progressBar1" />-->

        <android.webkit.WebView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/webView1" />
    </RelativeLayout>

</LinearLayout>
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,297 questions
{count} votes

Accepted answer
  1. Benjamin Blanco 96 Reputation points
    2021-05-12T20:14:16.497+00:00

    All I did was create a new project, copied over the layout, code, and Manifest settings, and it works fine. So, I guess something on my original project dependencies or something was corrupted.

    0 comments No comments

0 additional answers

Sort by: Most helpful