Error Inflating Class <unknown>

Nathan Sokalski 4,126 Reputation points

When running my app, I receive the following message:


Binary XML file line #1 in com.companyname.illusionexperimental:layout/activity_main: Binary XML file line #1 in com.companyname.illusionexperimental:layout/experimentallayout: Error inflating class <unknown>

experimentallayout is an XML layout file included in activity_main as follows:

<include android:visibility="visible" android:id="@+id/incExperimentalLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_column="0" android:layout_row="0" layout="@layout/experimentallayout"/>

Both activity_main and ExperimentalLayout.xml have the following as line #1 (the line stated in the error message):

<?xml version="1.0" encoding="utf-8"?>

The Designer in Visual Studio 2022 displays the files without any problem, and compiles without any problem. How can I determine what the problem is?

A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,315 questions
Microsoft Technologies based on the .NET software framework.
3,546 questions
{count} votes