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

Non-SDK usage causing RichPathView.setVectorDrawable to throw an exception when targeting API Level 31 #76

Open
tomdug opened this issue Aug 24, 2021 · 1 comment · May be fixed by #77

Comments

@tomdug
Copy link

tomdug commented Aug 24, 2021

With the release of Android 12, a bunch of non-SDK interfaces were removed (see this).

And this library uses reflection to call this non-SDK method with is now blocked in Android 12:
Landroid/util/PathParser;->createPathFromPathData(Ljava/lang/String;)Landroid/graphics/Path;

Trying to call RichPathView.setVectorDrawable thus causes this exception to be thrown:

W/ Accessing hidden method Landroid/util/PathParser;->createPathFromPathData(Ljava/lang/String;)Landroid/graphics/Path; (max-target-r, reflection, denied)
W/System.err: java.lang.NoSuchMethodException: android.util.PathParser.createPathFromPathData [class java.lang.String]
        at java.lang.Class.getMethod(Class.java:2103)
        at java.lang.Class.getDeclaredMethod(Class.java:2081)
        at com.richpath.pathparser.PathParserCompatApi21.getCreatePathFromPathDataMethod(PathParserCompatApi21.java:37)
        at com.richpath.pathparser.PathParserCompatApi21.createPathFromPathData(PathParserCompatApi21.java:21)
        at com.richpath.pathparser.PathParser.createPathFromPathData(PathParser.java:18)
        at com.richpath.RichPath.<init>(RichPath.java:71)
        at com.richpath.util.XmlParser.parsePathElement(XmlParser.java:87)
        at com.richpath.util.XmlParser.parseVector(XmlParser.java:55)
        at com.richpath.RichPathView.setVectorDrawable(RichPathView.java:84)
@tarek360
Copy link
Owner

tarek360 commented Aug 24, 2021 via email

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