Error inflating class android.support.v7.widget.AppCompatImageButton
Closed this issue · 3 comments
When I tried to add TextFieldBoxes
and ExtendedEditText
to my layout.
I got an exception when inflate layout.
Could you please have a look?
Thank you a lot.
java.lang.RuntimeException: Unable to start activity ComponentInfo{pcdt.app/pcdt.app.ui.LoginActivity}: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Binary XML file line #0: Error inflating class android.support.v7.widget.AppCompatImageButton at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3253) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349) at android.app.ActivityThread.access$1100(ActivityThread.java:221) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7224) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Binary XML file line #0: Error inflating class android.support.v7.widget.AppCompatImageButton at android.view.LayoutInflater.inflate(LayoutInflater.java:551) at android.view.LayoutInflater.inflate(LayoutInflater.java:429) at android.view.LayoutInflater.inflate(LayoutInflater.java:380) at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:474) at android.app.Activity.setContentView(Activity.java:2387) at pcdt.app.ui.LoginActivity.onCreate(LoginActivity.java:19) at android.app.Activity.performCreate(Activity.java:6876) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349) at android.app.ActivityThread.access$1100(ActivityThread.java:221) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7224) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class android.support.v7.widget.AppCompatImageButton at android.view.LayoutInflater.inflate(LayoutInflater.java:551) at android.view.LayoutInflater.inflate(LayoutInflater.java:429) at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.initViews(TextFieldBoxes.java:360) at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.onFinishInflate(TextFieldBoxes.java:241) at android.view.LayoutInflater.rInflate(LayoutInflater.java:868) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.rInflate(LayoutInflater.java:855) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.inflate(LayoutInflater.java:527) at android.view.LayoutInflater.inflate(LayoutInflater.java:429) at android.view.LayoutInflater.inflate(LayoutInflater.java:380) at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:474) at android.app.Activity.setContentView(Activity.java:2387) at pcdt.app.ui.LoginActivity.onCreate(LoginActivity.java:19) at android.app.Activity.performCreate(Activity.java:6876) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349) at android.app.ActivityThread.access$1100(ActivityThread.java:221) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7224) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class android.support.v7.widget.AppCompatImageButton at android.view.LayoutInflater.createView(LayoutInflater.java:657) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716) at android.view.LayoutInflater.rInflate(LayoutInflater.java:847) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.inflate(LayoutInflater.java:527) at android.view.LayoutInflater.inflate(LayoutInflater.java:429) at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.initViews(TextFieldBoxes.java:360) at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.onFinishInflate(TextFieldBoxes.java:241) at android.view.LayoutInflater.rInflate(LayoutInflater.java:868) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.rInflate(LayoutInflater.java:855) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.inflate(LayoutInflater.java:527) at android.view.LayoutInflater.inflate(LayoutInflater.java:429) at android.view.LayoutInflater.inflate(LayoutInflater.java:380) at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:474) at android.app.Activity.setContentView(Activity.java:2387) at pcdt.app.ui.LoginActivity.onCreate(LoginActivity.java:19) at android.app.Activity.performCreate(Activity.java:6876) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349) at android.app.ActivityThread.access$1100(ActivityThread.java:221) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7224) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance(Native Method) at android.view.LayoutInflater.createView(LayoutInflater.java:631) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716) at android.view.LayoutInflater.rInflate(LayoutInflater.java:847) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.inflate(LayoutInflater.java:527) at android.view.LayoutInflater.inflate(LayoutInflater.java:429) at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.initViews(TextFieldBoxes.java:360) at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.onFinishInflate(TextFieldBoxes.java:241) at android.view.LayoutInflater.rInflate(LayoutInflater.java:868) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.rInflate(LayoutInflater.java:855) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.inflate(LayoutInflater.java:527) at android.view.LayoutInflater.inflate(LayoutInflater.java:429) at android.view.LayoutInflater.inflate(LayoutInflater.java:380) at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:474) at android.app.Activity.setContentView(Activity.java:2387) at pcdt.app.ui.LoginActivity.onCreate(LoginActivity.java:19) at android.app.Activity.performCreate(Activity.java:6876) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349) at android.app.ActivityThread.access$1100(ActivityThread.java:221) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7224) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 13: TypedValue{t=0x2/d=0x7f03015e a=-1} at android.content.res.TypedArray.getDrawable(TypedArray.java:883) at android.view.View.<init>(View.java:4225) at android.widget.ImageView.<init>(ImageView.java:150) at android.widget.ImageButton.<init>(ImageButton.java:85) at android.widget.ImageButton.<init>(ImageButton.java:81) at android.support.v7.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:73) at android.support.v7.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:69) at java.lang.reflect.Constructor.newInstance(Native Method) at android.view.LayoutInflater.createView(LayoutInflater.java:631) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716) at android.view.LayoutInflater.rInflate(LayoutInflater.java:847) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.inflate(LayoutInflater.java:527) at android.view.LayoutInflater.inflate(LayoutInflater.java:429) at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.initViews(TextFieldBoxes.java:360) at studio.carbonylgroup.textfieldboxes.TextFieldBoxes.onFinishInflate(TextFieldBoxes.java:241) at android.view.LayoutInflater.rInflate(LayoutInflater.java:868) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.rInflate(LayoutInflater.java:855) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) at android.view.LayoutInflater.inflate(LayoutInflater.java:527) at android.view.LayoutInflater.inflate(LayoutInflater.java:429) at android.view.LayoutInflater.inflate(LayoutInflater.java:380) at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:474) at android.app.Activity.setContentView(Activity.java:2387) at pcdt.app.ui.LoginActivity.onCreate(LoginActivity.java:19) at android.app.Activity.performCreate(Activity.java:6876) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349) at android.app.ActivityThread.access$1100(ActivityThread.java:221) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7224) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Here is my xml:
`
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include
android:id="@+id/viewHeader"
layout="@layout/layout_header_idol" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/login"
android:textAllCaps="true"
android:textColor="@android:color/black"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="@+id/login_account_text"
style="@style/Prelogin.TextTitle"
android:text="@string/account" />
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:labelText="Label">
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
android:id="@+id/extended_et"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</studio.carbonylgroup.textfieldboxes.TextFieldBoxes>
<TextView
android:id="@+id/login_password_text"
style="@style/Prelogin.TextTitle"
android:text="@string/password" />
</LinearLayout>
I had tried with a new xml with TextFieldBoxes
and ExtendedEditText
only, but crash keeps happen.
I changed the theme of activity and it works.
So I close this issue. Thank you for support :)