Skip to content

Conversation

@meghneelgore
Copy link

Removed reflection on java.lang.String. Was causing a crash on Android M

@andreidiaconu
Copy link

Can someone take a look at this? I also encountered this issue and unless this gets merged, the library does not work on android 6

@tinsukE
Copy link

tinsukE commented Jan 7, 2016

I'm using this fix in my fork https://github.com/tinsukE/svg-android. You can use it in gradle/maven with https://jitpack.io/:

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

...

compile 'com.github.tinsukE:svg-android:2.0.6-1'

@vitorprado
Copy link

@tinsukE your repo isn't listed in mavancentral.. how can I use your fork?

@tinsukE
Copy link

tinsukE commented Jan 18, 2016

@vitorprado I'm sorry I wasn't clear. I've updated my answer, and you can check out more about it:
https://jitpack.io/#tinsukE/svg-android

@vitorprado
Copy link

@tinsukE Thanks!

public ParserHelper(String str, int pos) {
try {
this.s = (char[]) STRING_CHARS.get(str);
this.s = str.toCharArray();
Copy link

@refreshingdev refreshingdev Aug 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be costly, because toCharArray() copies the characters, as the javadoc says. This object might be constructed many times even during processing a single image. I have changed s to be a String, and use charAt() instead of getting from an array. Should charAt() be fast, it is a native method in newer SDKs, older use array access inside.
Should actually measure performance, it works as fast as previously (as perceived) for me anyway.

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

Successfully merging this pull request may close these issues.

5 participants