Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force closes the app when running KitKat. #92

Closed
GabrielKuka opened this issue Mar 18, 2017 · 22 comments
Closed

Force closes the app when running KitKat. #92

GabrielKuka opened this issue Mar 18, 2017 · 22 comments
Assignees
Labels
Milestone

Comments

@GabrielKuka
Copy link

Everythings works fine with devices running Lollipop and higher. When I test the app with an emulator running Kitkat, it force closes and the logcat says:

android.view.InflateException: Binary XML file line #27: Error inflating class br.com.mauker.materialsearchview.MaterialSearchView

How can I fix this issue? Is there any change I can avoid it?

@Mauker1
Copy link
Owner

Mauker1 commented Mar 18, 2017

Could you show the full stack trace please?

@GabrielKuka
Copy link
Author

03-19 04:43:27.760 1959-1959/com.libraryhf.libraryharryfultz E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.libraryhf.libraryharryfultz, PID: 1959
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.libraryhf.libraryharryfultz/com.libraryhf.libraryharryfultz.activity.Dashboard}: android.view.InflateException: Binary XML file line #27: Error inflating class br.com.mauker.materialsearchview.MaterialSearchView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #27: Error inflating class br.com.mauker.materialsearchview.MaterialSearchView
at android.view.LayoutInflater.createView(LayoutInflater.java:621)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:756)
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:840)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:288)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.libraryhf.libraryharryfultz.activity.Dashboard.onCreate(Dashboard.java:76)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5017) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:595)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:756) 
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:840) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:288) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
at com.libraryhf.libraryharryfultz.activity.Dashboard.onCreate(Dashboard.java:76) 
at android.app.Activity.performCreate(Activity.java:5231) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5017) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/ic_clear.xml from drawable resource ID #0x7f020069
at android.content.res.Resources.loadDrawable(Resources.java:2101)
at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
at br.com.mauker.materialsearchview.MaterialSearchView.initStyle(MaterialSearchView.java:322)
at br.com.mauker.materialsearchview.MaterialSearchView.(MaterialSearchView.java:208)
at br.com.mauker.materialsearchview.MaterialSearchView.(MaterialSearchView.java:193)
at java.lang.reflect.Constructor.constructNative(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
at android.view.LayoutInflater.createView(LayoutInflater.java:595) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:756) 
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:840) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:288) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
at com.libraryhf.libraryharryfultz.activity.Dashboard.onCreate(Dashboard.java:76) 
at android.app.Activity.performCreate(Activity.java:5231) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5017) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #1: invalid drawable tag vector
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:933)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:877)
at android.content.res.Resources.loadDrawable(Resources.java:2097)
at android.content.res.TypedArray.getDrawable(TypedArray.java:602) 
at br.com.mauker.materialsearchview.MaterialSearchView.initStyle(MaterialSearchView.java:322) 
at br.com.mauker.materialsearchview.MaterialSearchView.(MaterialSearchView.java:208) 
at br.com.mauker.materialsearchview.MaterialSearchView.(MaterialSearchView.java:193) 
at java.lang.reflect.Constructor.constructNative(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
at android.view.LayoutInflater.createView(LayoutInflater.java:595) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:756) 
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:840) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:288) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
at com.libraryhf.libraryharryfultz.activity.Dashboard.onCreate(Dashboard.java:76) 
at android.app.Activity.performCreate(Activity.java:5231) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5017) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
at dalvik.system.NativeStart.main(Native Method) 

@GabrielKuka
Copy link
Author

I am doing a big project and only bug left here is this. Please DO HELP ME out. Thank you.

@Mauker1
Copy link
Owner

Mauker1 commented Mar 19, 2017

Inside your app build.gradle file try to add this inside the defaultConfig:

android {  
   defaultConfig {  
     vectorDrawables.useSupportLibrary = true  
    }  
 }

@Mauker1
Copy link
Owner

Mauker1 commented Mar 19, 2017

I believe this is a problem with the vector drawables on the new support lib versions, and I'm addressing this change on the upcoming version 1.2.1. But first, try that change I've suggested and see if it works. I'll release the updated version later this week.

@GabrielKuka
Copy link
Author

I already have that line in build.gradle. And it doesn't work. Is there any way around this issue? Thank you

@Mauker1
Copy link
Owner

Mauker1 commented Mar 19, 2017

Hmmm. I think I'll release the update today then, so you can test it to check if the problem persists.

@GabrielKuka
Copy link
Author

Okay. Thank you for your commitment. I appreciate it sir.

@Mauker1 Mauker1 added the bug label Mar 19, 2017
@Mauker1
Copy link
Owner

Mauker1 commented Mar 20, 2017

Version 1.2.1 is out, try it and see if it works.

@GabrielKuka
Copy link
Author

It still force stops the app and shows the same stack trace.

@Mauker1
Copy link
Owner

Mauker1 commented Mar 20, 2017

I will have to dig deeper on this then.

@Mauker1 Mauker1 self-assigned this Mar 20, 2017
@GabrielKuka
Copy link
Author

Please do it. And notify me if you have any updates please.

@Mauker1
Copy link
Owner

Mauker1 commented Mar 20, 2017

Is this happening only on kitkat? Can you test on older devices?

@GabrielKuka
Copy link
Author

I will create another emulater with jelly bean and test it out right now

@Mauker1
Copy link
Owner

Mauker1 commented Mar 20, 2017

Thank you. I will try to debug it here on a KK device.

@Mauker1
Copy link
Owner

Mauker1 commented Mar 20, 2017

I think I got it. I will run some tests and if it works I'll release a 1.2.2 today.

@GabrielKuka
Copy link
Author

Update as soon as you can please. Thank you very much sir.

@GabrielKuka
Copy link
Author

I just tested it with Jelly Bean device and the error persists.

@Mauker1
Copy link
Owner

Mauker1 commented Mar 20, 2017

The fix worked on my KK device. I'll push an update.

@Mauker1 Mauker1 added this to the 1.2.2 milestone Mar 20, 2017
@Mauker1
Copy link
Owner

Mauker1 commented Mar 20, 2017

@GabrielKuka Can you confirm if it's working on your devices?

@GabrielKuka
Copy link
Author

The searchview is completely working as it should. Thank you very much.

@Mauker1
Copy link
Owner

Mauker1 commented Mar 20, 2017

Thank you for your assistance as well Gabriel. I hope you enjoy the lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants