TeamNewPipe / NewPipeExtractor

NewPipe's core library for extracting data from streaming sites
GNU General Public License v3.0
1.39k stars 420 forks source link

App crashed when the android version is below 12 #1217

Closed joh9911 closed 2 months ago

joh9911 commented 2 months ago

Checklist

Affected version

0.24.2

Steps to reproduce the bug

  1. val factory: ListLinkHandlerFactory = youtubeService.playlistLHFactory return try { factory.fromUrl(playlistId) // fromUrl }

  2. @Override public ListLinkHandler fromUrl(final String url) throws ParsingException { try { final URL urlObj = Utils.stringToURL(url); final String listID = Utils.getQueryValue(urlObj, "list"); // getQueryValue }

  3. @Nullable public static String getQueryValue(@Nonnull final URL url, final String parameterName) { ../ final String urlQuery = url.getQuery(); final String query = decodeUrlUtf8(params[0]); // decodeUrlUtf8 } ../ }

  4. public static String decodeUrlUtf8(final String url) { return URLDecoder.decode(url, StandardCharsets.UTF_8); }

Log Error: java.lang.NoSuchMethodError: No static method decode(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/lang/String; in class Ljava/net/URLDecoder; or its super classes (declaration of 'java.net.URLDecoder' appears in /apex/com.android.art/javalib/core-oj.jar)

Expected behavior

No response

Actual behavior

No response

Screenshots/Screen recordings

No response

Logs

No response

Additional information

It only happens when the Android Version is below 12, from 13 to above it works

ShareASmile commented 2 months ago

Thank you for opening an issue. Please follow step given in this comment to resolve it.

See Readme Usage Section Note it clearly says

To use NewPipe Extractor in Android projects with a minSdk below 33, core library desugaring with the desugar_jdk_libs_nio artifact is required.