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

Compressed floats result in NumberFormatException #20

Open
nolanlawson opened this issue Jul 28, 2015 · 0 comments
Open

Compressed floats result in NumberFormatException #20

nolanlawson opened this issue Jul 28, 2015 · 0 comments

Comments

@nolanlawson
Copy link

SVG and VectorDrawable paths can both contain strings like 1.5.5, because the parser interprets it as 1.5 0.5. However, vector-compat crashes if the path includes such a string, and you see an error in Logcat like:

E/PathParser(  681): error in parsing "s 50.916.958150 0 50"
D/AndroidRuntime(  681): Shutting down VM
W/dalvikvm(  681): threadid=1: thread exiting with uncaught exception (group=0x41590ba8)
E/AndroidRuntime(  681): FATAL EXCEPTION: main
E/AndroidRuntime(  681): Process: com.wnafee.vector.compat.demo, PID: 681
E/AndroidRuntime(  681): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wnafee.vector.compat.demo/com.wnafee.vector.compat.demo.MainActivity}: android.cont
ent.res.Resources$NotFoundException: File res/drawable/basic_bezier.xml from drawable resource ID #0x7f02003b
E/AndroidRuntime(  681):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
E/AndroidRuntime(  681):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
E/AndroidRuntime(  681):        at android.app.ActivityThread.access$800(ActivityThread.java:135)
E/AndroidRuntime(  681):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
E/AndroidRuntime(  681):        at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(  681):        at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(  681):        at android.app.ActivityThread.main(ActivityThread.java:5001)
E/AndroidRuntime(  681):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  681):        at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(  681):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
E/AndroidRuntime(  681):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
E/AndroidRuntime(  681):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(  681): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/basic_bezier.xml from drawable resource ID #0x7f02003b
E/AndroidRuntime(  681):        at android.content.res.Resources.loadDrawable(Resources.java:2096)
E/AndroidRuntime(  681):        at android.content.res.Resources.getDrawable(Resources.java:700)
E/AndroidRuntime(  681):        at com.wnafee.vector.compat.ResourcesCompat.getDrawable(ResourcesCompat.java:34)
E/AndroidRuntime(  681):        at com.wnafee.vector.compat.demo.MainActivity.onCreate(MainActivity.java:63)
E/AndroidRuntime(  681):        at android.app.Activity.performCreate(Activity.java:5231)
E/AndroidRuntime(  681):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime(  681):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
E/AndroidRuntime(  681):        ... 11 more
E/AndroidRuntime(  681): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #2: invalid drawable tag vector
E/AndroidRuntime(  681):        at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:933)
E/AndroidRuntime(  681):        at android.graphics.drawable.Drawable.createFromXml(Drawable.java:877)
E/AndroidRuntime(  681):        at android.content.res.Resources.loadDrawable(Resources.java:2092)
E/AndroidRuntime(  681):        ... 17 more
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

1 participant