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

Error "Retrieving groups by name is not supported on this platform" #42

Closed
juanro49 opened this issue Jan 6, 2022 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@juanro49
Copy link

juanro49 commented Jan 6, 2022

Hi!

I'm using this library for future new function in my project FeedTV, and when I parse the M3U file, I get an exception with the error "Retrieving groups by name is not supported on this platform".

2022-01-06 00:53:17.341 7411-7411/org.juanro.feedtv E/AndroidRuntime: FATAL EXCEPTION: main Process: org.juanro.feedtv, PID: 7411 java.lang.UnsupportedOperationException: Retrieving groups by name is not supported on this platform. at kotlin.internal.PlatformImplementations.getMatchResultNamedGroup(PlatformImplementations.kt:42) at kotlin.text.MatcherMatchResult$groups$1.get(Regex.kt:372) at kotlin.text.jdk8.RegexExtensionsJDK8Kt.get(RegexExtensions.kt:34) at net.bjoernpetersen.m3u.M3uParser.parseExtended(M3uParser.kt:166) at net.bjoernpetersen.m3u.M3uParser.parse(M3uParser.kt:137) at net.bjoernpetersen.m3u.M3uParser.parse(M3uParser.kt:54) at net.bjoernpetersen.m3u.M3uParser.parse$default(M3uParser.kt:52) at net.bjoernpetersen.m3u.M3uParser.parse(Unknown Source:2) at org.juanro.feedtv.M3UParser$1.onResponse(M3UParser.java:150) at org.juanro.feedtv.M3UParser$1.onResponse(M3UParser.java:125) at org.juanro.feedtv.Http.InputStreamVolleyRequest.deliverResponse(InputStreamVolleyRequest.java:57) at org.juanro.feedtv.Http.InputStreamVolleyRequest.deliverResponse(InputStreamVolleyRequest.java:29) at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:102) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7839) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

It seems to be because of using name groups in Regex (seconds and title)

private const val EXTENDED_INFO = """${COMMENT_START}EXTINF:(?<$SECONDS>[-]?\d+).*,(?<$TITLE>.+)"""

I'm using this version:
implementation "com.github.bjoernpetersen:m3u-parser:1.1.0"

@BjoernPetersen BjoernPetersen added the bug Something isn't working label Jan 6, 2022
@BjoernPetersen
Copy link
Owner

Android's half-assed Regex implementation really is annoying sometimes. However, I'm glad someone else is getting a use out of this library, and thankfully this bug is easily fixed. Thanks for opening an issue!

@BjoernPetersen
Copy link
Owner

I've released version 1.2.0 with the fix. That version also contains a compilation JDK change, so please notify me if the version doesn't work on Android!

@juanro49
Copy link
Author

juanro49 commented Jan 6, 2022

I've released version 1.2.0 with the fix. That version also contains a compilation JDK change, so please notify me if the version doesn't work on Android!

Thank you so much!!!!

I try the new version and now work fine! 😋
2022-01-06_18-46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants