Skip to content

Commit

Permalink
[tests] fix ClassLibraryMainLauncherRuns
Browse files Browse the repository at this point in the history
This test was crashing on app start with:

    Java.Lang.RuntimeException: Unable to start activity ComponentInfo{com.xamarin.classlibrarymainlauncherruns/com.xamarin.classlibrarymainlauncherruns.MainActivity}: android.view.InflateException: Binary XML file line #1 in com.xamarin.classlibrarymainlauncherruns:layout/foo: Binary XML file line #1: You must supply a layout_width attribute.
    ---> Android.Views.InflateException: Binary XML file line #1 in com.xamarin.classlibrarymainlauncherruns:layout/foo: Binary XML file line #1: You must supply a layout_width attribute.
    ---> Java.Lang.UnsupportedOperationException: Binary XML file line #1: You must supply a layout_width attribute.
    --- End of managed Java.Lang.UnsupportedOperationException stack trace ---
    java.lang.UnsupportedOperationException: Binary XML file line #1: You must supply a layout_width attribute.

It seems like this would have always been broken, so I'm not exactly
sure how it is passing in some cases.
  • Loading branch information
jonathanpeppers committed Apr 1, 2021
1 parent 28f4a06 commit bebd441
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,13 @@ public void ClassLibraryMainLauncherRuns ()
// Remove the default MainActivity.cs & AndroidResources
app.AndroidResources.Clear ();
app.AndroidResources.Add (new AndroidItem.AndroidResource ("Resources\\layout\\foo.xml") {
TextContent = () => "<?xml version=\"1.0\" encoding=\"utf-8\" ?><LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\" />"
TextContent = () =>
@"<?xml version=""1.0"" encoding=""utf-8""?>
<LinearLayout
xmlns:android=""http://schemas.android.com/apk/res/android""
android:layout_width=""fill_parent""
android:layout_height=""wrap_content""
/>"
});
app.Sources.Remove (app.GetItem ("MainActivity.cs"));

Expand Down

0 comments on commit bebd441

Please sign in to comment.