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

NPE on Android Kitkat #57

Open
mahasadhu opened this issue Jun 24, 2016 · 4 comments
Open

NPE on Android Kitkat #57

mahasadhu opened this issue Jun 24, 2016 · 4 comments

Comments

@mahasadhu
Copy link

Hi there, I'm getting error on Android 4.4 Kitkat. Following is the error log cat

E/VectorDrawableCompat: parser error org.xmlpull.v1.XmlPullParserException: Binary XML file line #1<vector> tag requires viewportWidth > 0 at android.support.graphics.drawable.VectorDrawableCompat.updateStateFromTypedArray(VectorDrawableCompat.java:535) at android.support.graphics.drawable.VectorDrawableCompat.inflate(VectorDrawableCompat.java:472) at android.support.graphics.drawable.VectorDrawableCompat.createFromXmlInner(VectorDrawableCompat.java:436) at android.support.graphics.drawable.VectorDrawableCompat.create(VectorDrawableCompat.java:418) at mehdi.sakout.aboutpage.AboutPage.createItem(AboutPage.java:360) at mehdi.sakout.aboutpage.AboutPage.addItem(AboutPage.java:243) at mehdi.sakout.aboutpage.AboutPage.addEmail(AboutPage.java:61) at com.mahasadhu.route.Activity.About.onCreate(About.java:36) 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)

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.mahasadhu.route, PID: 2403 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mahasadhu.route/com.mahasadhu.route.Activity.About}: java.lang.NullPointerException 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: java.lang.NullPointerException at android.support.v4.graphics.drawable.DrawableWrapperDonut.getState(DrawableWrapperDonut.java:147) at android.support.v4.graphics.drawable.DrawableWrapperDonut.setTintList(DrawableWrapperDonut.java:267) at android.support.v4.graphics.drawable.DrawableWrapperDonut.setTint(DrawableWrapperDonut.java:261) at android.support.v4.graphics.drawable.DrawableCompatBase.setTint(DrawableCompatBase.java:36) at android.support.v4.graphics.drawable.DrawableCompat$BaseDrawableImpl.setTint(DrawableCompat.java:89) at android.support.v4.graphics.drawable.DrawableCompat.setTint(DrawableCompat.java:380) at mehdi.sakout.aboutpage.AboutPage.createItem(AboutPage.java:370) at mehdi.sakout.aboutpage.AboutPage.addItem(AboutPage.java:243) at mehdi.sakout.aboutpage.AboutPage.addEmail(AboutPage.java:61) at com.mahasadhu.route.Activity.About.onCreate(About.java:36) 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)

I've tested it on lollipop, it works fine

@mahasadhu
Copy link
Author

Following is the code that i use

View aboutPage = new AboutPage(this)
.isRTL(false)
.setDescription("DescDesc\nDesc")
.setImage(R.drawable.iconsm)
.addItem(new Element().setTitle("Version 0.9 (beta)"))
.addGroup("Connect with us")
.addEmail("[email protected]")
.addWebsite("http://www.asdqweasdwe.com/")
.create();

I just tested it, if i remove addEmail and addWebsite the NPE is gone.
So maybe this issue is related to that

@medyo
Copy link
Owner

medyo commented Jul 3, 2016

Hi @mahasadhu,

Please take a look at : #50 (comment)

@rajeevjaiswal
Copy link

Hi @medyo I have added vectorDrawables.useSupportLibrary = true in gradle still it is crashing in kitkat.
Any other solution?

@medyo
Copy link
Owner

medyo commented Aug 20, 2016

Hi @rajeevjaiswal, please give a try to the last android-about-page version

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