RichPath icon indicating copy to clipboard operation
RichPath copied to clipboard

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

Open Shailevy opened this issue 7 years ago • 10 comments

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 avatar Oct 29 '18 16:10 Shailevy

I'm able to reproduce only on an obfuscated APK

Checking it out

Shailevy avatar Oct 30 '18 09:10 Shailevy

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

Shailevy avatar Oct 30 '18 09:10 Shailevy

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?

tarek360 avatar Oct 30 '18 09:10 tarek360

Hi, Thanks, I will email you shortly

Shailevy avatar Oct 30 '18 14:10 Shailevy

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 avatar Oct 30 '18 16:10 Shailevy

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

Shailevy avatar Oct 30 '18 17:10 Shailevy

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 avatar Oct 30 '18 18:10 tarek360

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 avatar Jan 01 '19 16:01 Shailevy

Any updated ? is this great library abandoned ?

Shailevy avatar Mar 31 '19 09:03 Shailevy

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.

tarek360 avatar Mar 31 '19 15:03 tarek360