Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Some device report (crashlytics) crash Caused by java.lang.NumberFormatException #41

Open
Shailevy opened this issue Oct 29, 2018 · 10 comments
Labels

Comments

@Shailevy
Copy link

Hi,
Great library, We used in our production app and we love it, keep up the good work.

But we some devices are reporting a crash with this stack trace:
"Caused by java.lang.NumberFormatException
For input string: "round""

java.lang.Integer.parseInt (Integer.java:615)
java.lang.Integer.parseInt (Integer.java:650)
com.richpath.c.c.a (XmlParser.java:139)
com.richpath.RichPath.inflate (RichPath.java:419)
com.richpath.c.c.b (XmlParser.java:88)
com.richpath.c.c.a (XmlParser.java:55)
com.richpath.RichPathView.setVectorDrawable (RichPathView.java:84)
com.richpath.RichPathView.setupAttributes (RichPathView.java:67)
com.richpath.RichPathView. (RichPathView.java:45)
com.richpath.RichPathView. (RichPathView.java:39)

According to the "round" string I see, I'm guessing it might have something to do with our vector , our path's have
android:strokeLineCap="round"
android:strokeLineJoin="round"

In them.. is that a problem ?

(we use com.github.tarek360.RichPath:animator:0.1.1 )

@Shailevy
Copy link
Author

I'm able to reproduce only on an obfuscated APK

Checking it out

@Shailevy
Copy link
Author

Correction: it's fine in an APK and doesn't work when distributed from an android bundle via the play store (aab)..

I find it very strange and worrying.. probably has nothing to do with the library

@tarek360
Copy link
Owner

Hi @Shailevy thank you for using RichPath, I will investigate in that crash.
I am curious to download your app, could you send the play store link?

@Shailevy
Copy link
Author

Hi,
Thanks, I will email you shortly

@Shailevy
Copy link
Author

I emailed you.
But we can try another approach.. can you obfuscate and publish the sample app as an aab (bundle) in the play store ?

I will opt-in to the beta and then we can see if this is a generic problem or app-specific

@Shailevy
Copy link
Author

Shailevy commented Oct 30, 2018

Me again,
Sorry for all the messages, its a new production app and everyone here is in panic mode and I would rather annoy you with too much updates then let you waste time on this.

Turns out you can ran an Android Bundle with android studio:

The problem reproduces right away so I was able to debug it:

getAttributeStrokeLineCap in XmlParser.class calls getAttributeValue(xpp, attributeName)

The function:
private static String getAttributeValue(XmlResourceParser xpp, String attributeName) {
return xpp.getAttributeValue("http://schemas.android.com/apk/res/android", attributeName);
}

For my XML
Will return "1" when the project is compiled to an APK and "round" when the project is compiled to a bundle.

I'm guessing it has something to do with the schemas.android.com/apk/res/android name space that hard-coded in the library.. I'm still trying to figure out how to overcome this, I will keep updating you here if I make progress

----- Update:
I will leave this to you, as far as it seems right now the library can't support App Bundles without some updating.
I didn't find helpful info in stackoverflow but I did find many complaints about problems with app bundles. So I decided to switch back to APK's without looking back.

However,
I will gladly help you find out the problem and test a fix and etc... feel free to contact me anytime.
I also suggest you reproduce at your end and warn library users not to migrate to bundles before a fix is available

@tarek360
Copy link
Owner

Thank you for these information, I will try to figure out this issue in the weekend and I will contact if I have update or need to ask question! Thank you again!

@tarek360 tarek360 added the bug label Oct 30, 2018
@Shailevy
Copy link
Author

Shailevy commented Jan 1, 2019

Please don't forget this issue so we can all peek on App-Bundles again at some point.
I will be happy to help

@Shailevy
Copy link
Author

Any updated ? is this great library abandoned ?

@tarek360
Copy link
Owner

Hi @Shailevy
Actually I was very busy in the last month and only me work on this library, I have new features to add and also some fixes, but not sure if I can find a time to do that.

I would suggest if you have some time to do this fix and open a pull request! I think it should be easier for you since you're familiar with the bug and know how to reproduce it.

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

No branches or pull requests

2 participants