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

Not working on api lower than 21 #5

Open
NathanMBui opened this issue Jul 31, 2018 · 3 comments
Open

Not working on api lower than 21 #5

NathanMBui opened this issue Jul 31, 2018 · 3 comments

Comments

@NathanMBui
Copy link

Your sample app does not run in device with api lower than 21.
It may be because of vector drawable.
I produce this error on genymotion api 19

E/AndroidRuntime( 2575): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hanks.demo/com.hanks.demo.PasscodeActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class com.hanks.passcodeview.PasscodeView
E/AndroidRuntime( 2575): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
E/AndroidRuntime( 2575): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
E/AndroidRuntime( 2575): at android.app.ActivityThread.access$800(ActivityThread.java:135)
E/AndroidRuntime( 2575): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
E/AndroidRuntime( 2575): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 2575): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 2575): at android.app.ActivityThread.main(ActivityThread.java:5001)
E/AndroidRuntime( 2575): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2575): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 2575): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
E/AndroidRuntime( 2575): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
E/AndroidRuntime( 2575): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2575): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class com.hanks.passcodeview.PasscodeView
E/AndroidRuntime( 2575): at android.view.LayoutInflater.createView(LayoutInflater.java:620)
E/AndroidRuntime( 2575): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
E/AndroidRuntime( 2575): at android.view.LayoutInflater.inflate(LayoutInflater.java:469)
E/AndroidRuntime( 2575): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
E/AndroidRuntime( 2575): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
E/AndroidRuntime( 2575): at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
E/AndroidRuntime( 2575): at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
E/AndroidRuntime( 2575): at com.hanks.demo.PasscodeActivity.onCreate(PasscodeActivity.java:20)
E/AndroidRuntime( 2575): at android.app.Activity.performCreate(Activity.java:5231)
E/AndroidRuntime( 2575): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime( 2575): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
E/AndroidRuntime( 2575): ... 11 more
E/AndroidRuntime( 2575): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime( 2575): at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime( 2575): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
E/AndroidRuntime( 2575): at android.view.LayoutInflater.createView(LayoutInflater.java:594)
E/AndroidRuntime( 2575): ... 21 more
E/AndroidRuntime( 2575): Caused by: android.view.InflateException: Binary XML file line #70: Error inflating class
E/AndroidRuntime( 2575): at android.view.LayoutInflater.createView(LayoutInflater.java:620)
E/AndroidRuntime( 2575): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
E/AndroidRuntime( 2575): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
E/AndroidRuntime( 2575): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
E/AndroidRuntime( 2575): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
E/AndroidRuntime( 2575): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
E/AndroidRuntime( 2575): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
E/AndroidRuntime( 2575): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
E/AndroidRuntime( 2575): at android.view.View.inflate(View.java:17465)
E/AndroidRuntime( 2575): at com.hanks.passcodeview.PasscodeView.(PasscodeView.java:66)
E/AndroidRuntime( 2575): ... 24 more
E/AndroidRuntime( 2575): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime( 2575): at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime( 2575): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
E/AndroidRuntime( 2575): at android.view.LayoutInflater.createView(LayoutInflater.java:594)
E/AndroidRuntime( 2575): ... 33 more
E/AndroidRuntime( 2575): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/lock_bg_white.xml from drawable resource ID #0x7f020063
E/AndroidRuntime( 2575): at android.content.res.Resources.loadDrawable(Resources.java:2096)
E/AndroidRuntime( 2575): at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
E/AndroidRuntime( 2575): at android.view.View.(View.java:3554)
E/AndroidRuntime( 2575): at android.view.View.(View.java:3484)
E/AndroidRuntime( 2575): at android.view.ViewGroup.(ViewGroup.java:464)
E/AndroidRuntime( 2575): at android.widget.RelativeLayout.(RelativeLayout.java:236)
E/AndroidRuntime( 2575): ... 36 more
E/AndroidRuntime( 2575): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #2: invalid drawable tag vector
E/AndroidRuntime( 2575): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:933)
E/AndroidRuntime( 2575): at android.graphics.drawable.Drawabl

@khacdat1994
Copy link

Edit lock_bg_white.xml file without vector-drawable or duplicate and move one into drawable-v21 folder

@JobGetabu
Copy link

solved this in this pull request #10

@JobGetabu
Copy link

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

No branches or pull requests

3 participants