Research a lot about this issue and found the same question, which doesn't solve my problem. so starting a new question. Xamarin Android: Android.Views.InflateException - Error when loading Layout
Getting Xamairin forms : Android.Views.InflateException: Timeout exceeded getting exception details when loading layout.
Main.axml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFCDD2"
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_name"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/input_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:hint="@string/hint_name" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_email"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/input_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:hint="@string/hint_email" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_password"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/input_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:hint="@string/hint_password" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/btn_signup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/btn_sign_up"
android:background="@color/colorPrimary"
android:layout_marginTop="40dp"
android:textColor="@android:color/white" />
</LinearLayout>
I have not used layout:width and layout:height properties in my axml and only using an icon having 4kb size.
Please suggest a solution for this issue, thanks in advance...
Getting Xamairin forms : Android.Views.InflateException: Timeout exceeded getting exception details when loading layout.
There are two things needs to be confirmed before using TextInputLayout
:
Please make sure, Xamarin.Android.Support.Design
lib is correctly referenced in your Xamarin.Android
project. If you are using Xamarin.Forms
, it should be referenced by default.
Please make sure the Activity is of type Android.Support.V7.App.AppCompatActivity
.
If none of the above things help, please provide a basic demo that can reproduce the problem.
Update:
Upon testing on the project you shared. I found you need to use a Theme.AppCompat
theme for your activity, you can do that by following below steps:
Create a styles.xml
file under Resources\values\
folder with below codes:
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
</style>
</resources>
In MainActivity.cs
define the Activity
attribute to leverage AppTheme
like this:
[Activity(Label = "DinexFeedback", MainLauncher = true, Icon = "@drawable/icon",Theme ="@style/AppTheme")]
public class MainActivity : Android.Support.V7.App.AppCompatActivity
{
...
Then the project will run fine.