title: Xamarin Android - How to find location of failure
body: <p>I am studying Xamarin in Action and my practise application fails when I am deploying it to Android. Below is stack trace (There is much more than this and I am just pasting what I think is more relevant). I am finding it hard to figure out the location where the app is crashing. App never loads and always crashes when I debug it. How can I find the location of failure. As can be guessed, I am new to development with IOC. I am using Xamarin in Visual Studio to develop the app</p>
  
  <pre><code>Searching for '__android_log_print'.
  Probing '__android_log_print'.
  Found as '__android_log_print'.
   UNHANDLED EXCEPTION:
   Android.Content.Res.Resources+NotFoundException: Resource ID #0x0
     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in &lt;f32579baafc1404fa37ba3ec1abdc0bd&gt;:0 
     at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualObjectMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in &lt;7802aa64ad574c33adca332a3fa9706a&gt;:0 
     at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0005d] in &lt;7802aa64ad574c33adca332a3fa9706a&gt;:0 
     at Android.Views.LayoutInflater.Inflate (System.Int32 resource, Android.Views.ViewGroup root, System.Boolean attachToRoot) [0x0005a] in &lt;263adecfa58f4c449f1ff56156d886fd&gt;:0 
     at MvvmCross.Binding.Droid.Views.MvxLayoutInflater.Inflate (System.Int32 resource, Android.Views.ViewGroup root, System.Boolean attachToRoot) [0x0003e] in C:\projects\mvvmcross\MvvmCross\Binding\Droid\Views\MvxLayoutInflater.cs:137 
     at MvvmCross.Binding.Droid.BindingContext.MvxAndroidBindingContext.CommonInflate (System.Int32 resourceId, Android.Views.ViewGroup viewGroup, System.Boolean attachToRoot) [0x00013] in C:\projects\mvvmcross\MvvmCross\Binding\Droid\BindingContext\MvxAndroidBindingContext.cs:52 
     at MvvmCross.Binding.Droid.BindingContext.MvxAndroidBindingContext.BindingInflate (System.Int32 resourceId, Android.Views.ViewGroup viewGroup, System.Boolean attachToRoot) [0x00000] in C:\projects\mvvmcross\MvvmCross\Binding\Droid\BindingContext\MvxAndroidBindingContext.cs:36 
     at MvvmCross.Droid.Support.V7.RecyclerView.MvxRecyclerAdapter.InflateViewForHolder (Android.Views.ViewGroup parent, System.Int32 viewType, MvvmCross.Binding.Droid.BindingContext.IMvxAndroidBindingContext bindingContext) [0x0000d] in C:\projects\mvvmcross\MvvmCross-AndroidSupport\MvvmCross.Droid.Support.V7.RecyclerView\MvxRecyclerAdapter.cs:173 
     at MvvmCross.Droid.Support.V7.RecyclerView.MvxRecyclerAdapter.OnCreateViewHolder (Android.Views.ViewGroup parent, System.Int32 viewType) [0x00018] in C:\projects\mvvmcross\MvvmCross-AndroidSupport\MvvmCross.Droid.Support.V7.RecyclerView\MvxRecyclerAdapter.cs:155 
     at Android.Support.V7.Widget.RecyclerView+Adapter.n_OnCreateViewHolder_Landroid_view_ViewGroup_I (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_parent, System.Int32 viewType) [0x0000f] in &lt;aa282e0b3937455a861deaefaef6659d&gt;:0 
     at (wrapper dynamic-method) System.Object.e4bc17a2-2281-4b4b-a324-001bbf355990(intptr,intptr,intptr,int)
     --- End of managed Android.Content.Res.Resources+NotFoundException stack trace ---
   android.content.res.Resources$NotFoundException: Resource ID #0x0
      at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:190)
      at android.content.res.Resources.loadXmlResourceParser(Resources.java:2101)
      at android.content.res.Resources.getLayout(Resources.java:1115)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:424)
      at mvvmcross.droid.support.v7.recyclerview.MvxRecyclerAdapter.n_onCreateViewHolder(Native Method)
      at mvvmcross.droid.support.v7.recyclerview.MvxRecyclerAdapter.onCreateViewHolder(MvxRecyclerAdapter.java:59)
      at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6365)
      at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5563)
  
  
      at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5448)
      at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5444)
      at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2224)
      at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1551)
      at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1511)
      at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:595)
      at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3600)
      at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3329)
      at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3867)
      at android.view.View.layout(View.java:17637)
      at android.view.ViewGroup.layout(ViewGroup.java:5575)
      at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
      at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
      at android.view.View.layout(View.java:17637)
      at android.view.ViewGroup.layout(ViewGroup.java:5575)
      at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
      at android.view.View.layout(View.java:17637)
      at android.view.ViewGroup.layout(ViewGroup.java:5575)
      at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
      at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
      at android.view.View.layout(View.java:17637)
      at android.view.ViewGroup.layout(ViewGroup.java:5575)
      at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
      at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
      at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
      at android.view.View.layout(View.java:17637)
      at android.view.ViewGroup.layout(ViewGroup.java:5575)
      at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
      at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
      at android.view.View.layout(View.java:17637)
      at android.view.ViewGroup.layout(ViewGroup.java:5575)
      at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
      at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
      at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
      at android.view.View.layout(View.java:17637)
      at android.view.ViewGroup.layout(ViewGroup.java:5575)
      at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
      at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
      at com.android.internal.policy.DecorView.onLayout(DecorView.java:726)
      at android.view.View.layout(View.java:17637)
      at android.view.ViewGroup.layout(ViewGroup.java:5575)
      at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2346)
      at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2068)
      at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
      at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6337)
      at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
      at android.view.Choreographer.doCallbacks(Choreographer.java:686)
      at android.view.Choreographer.doFrame(Choreographer.java:621)
      at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
      at android.os.Handler.handleCallback(Handler.java:751)
      at android.os.Handler.dispatchMessage(Handler.java:95)
      at android.os.Looper.loop(Looper.java:154)
      at android.app.ActivityThread.main(ActivityThread.java:6119)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
  
  DllImport searching in: '__Internal' ('(null)').
  Searching for 'java_interop_jnienv_throw'.
  Probing 'java_interop_jnienv_throw'.
  Found as 'java_interop_jnienv_throw'.
  
  Unhandled Exception:
  Android.Content.Res.Resources+NotFoundException: Resource ID #0x0
    at (wrapper dynamic-method) System.Object.e4bc17a2-2281-4b4b-a324-001bbf355990(intptr,intptr,intptr,int)
  </code></pre>
  
  <p><strong>List View Class into which recycler is embedded:</strong></p>
  
  <pre><code>{
      [Activity(Label = "@string/ApplicationName")]
      public class ListOfElementsView : MvxAppCompatActivity&lt;Elements&gt;
      {
          protected override void OnCreate(Bundle savedInstanceState)
          {
              base.OnCreate(savedInstanceState);
  
              SetContentView(Resource.Layout.elements_view);
  
              var elements_list_view_toolbar = FindViewById&lt;Toolbar&gt;(Resource.Id.elements_list_view_toolbar);
              SetSupportActionBar(elements_list_view_toolbar);
  
              var elements_view_recyler_view = FindViewById&lt;MvxRecyclerView&gt;(Resource.Id.elements_view_recyler_view);
              elements_view_recyler_view.SetLayoutManager(new LinearLayoutManager(this));
  
          }
      }
  }
  </code></pre>
  
  <p><strong>elements_view.axml content</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:local="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
      &lt;android.support.design.widget.AppBarLayout
          android:layout_height="wrap_content"
          android:layout_width="match_parent"
          android:id="@+id/elements_list_view_toolbar_layout"&gt;
          &lt;include
              android:id="@+id/elements_list_view_toolbar"
              layout="@layout/toolbar"
              local:layout_scrollFlags="scroll|enterAlways" /&gt;
      &lt;/android.support.design.widget.AppBarLayout&gt;
      &lt;FrameLayout
          android:layout_below="@id/elements_list_view_toolbar_layout"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
          &lt;mvvmcross.droid.support.v7.recyclerview.MvxRecyclerView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:id="@+id/elements_view_recyler_view"
              local:MvxBind="ItemsSource Elements" /&gt;
      &lt;/FrameLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>element_recycler_view.axml content</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:local="http://schemas.android.com/apk/res-auto"
                  android:orientation="vertical"
                  android:layout_width="match_parent"
                  android:layout_height="50dp"&gt;
    &lt;TextView
      android:id="@+id/field1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_centerVertical="true"
      android:layout_alignParentLeft="true"
      android:layout_marginLeft="20dp"
      android:textSize="16sp"
      local:MvxBind="Text Field1"
      /&gt;
    &lt;TextView
      android:id="@+id/field2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_above="@id/field1"
      android:layout_alignParentLeft="true"
      android:layout_marginLeft="20dp"
      android:textSize="4sp"
      local:MvxBind="Text Field2"
      /&gt;
    &lt;TextView
      android:id="@+id/field3"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@id/field1"
      android:layout_alignParentLeft="true"
      android:layout_marginLeft="20dp"
      android:textSize="4sp"
      local:MvxBind="Text Field3"
      /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Also getting below warning recently. Is any of my configuration incorrect or improperly used?</p>
  
  <p><code>The element 'FrameLayout' has invalid child element 'mvvmcross.droid.support.v7.recyclerview.MvxRecyclerView'. List of possible elements expected: 'AbsoluteLayout, ViewGroup, View, ActionMenuView, LinearLayout, AdapterViewFlipper, AdapterViewAnimator, AdapterView, AnalogClock, AutoCompleteTextView, EditText, TextView, Button, CalendarView, FrameLayout, CheckBox, CompoundButton, CheckedTextView, Chronometer, DatePicker, DialerFilter, RelativeLayout, DigitalClock, ExpandableListView, ListView, AbsListView, Gallery, AbsSpinner, GridLayout, GridView, HorizontalScrollView, ImageButton, ImageView, ImageSwitcher, ViewSwitcher, ViewAnimator, MediaController, MultiAutoCompleteTextView, NumberPicker, ProgressBar, QuickContactBadge, RadioButton, RadioGroup, RatingBar, AbsSeekBar, ScrollView, SearchView, SeekBar, SlidingDrawer, Space, Spinner, StackView, Switch, TabHost, TableLayout, TableRow, TabWidget, TextClock, TextInputTimePickerView, TextSwitcher, TimePicker, ToggleButton, Toolbar, TwoLineListItem, VideoView, SurfaceView, ViewFlipper, ZoomButton, ZoomControls, android.webkit.WebView, android.gesture.GestureOverlayView, TextureView, ViewStub, fragment, Mvvm....   App.Droid\Resources\layout\elements_view.axml   19</code></p>