2

I implemented the PRDownloader in my gradle.

implementation 'com.mindorks.android:prdownloader:0.6.0'

But when I type PRDownloader in my adapter class it gives me the error "Unknown Reference for: PRDownloader". It's the only error Android Studio gives me. I use mavenCentral() instead of jcenter. Maybe this could be causing some problems.

Khumo Mashapa
  • 390
  • 1
  • 4
  • 13
  • 1
    Please, add the *Logcat output* to your post which is gonna show us any errors or warnings for we can help you out with your issue. – Jorge Luiz Jun 18 '22 at 02:19
  • 1
    My error comes up as I'm typing the code. The line is highlighted in red and gives me the Unknown reference error. I can't even run the Logcat. – Khumo Mashapa Jun 18 '22 at 11:19

1 Answers1

1

There isn't version 0.6.0, the latest one's 0.5.0.

Fix your code line to:

implementation 'com.mindorks.android:prdownloader:0.5.0'

Also on the following Gradle script build.gradle(Project: YOURPROJECTNAME) the jcenter() repository in repositories statement:

repositories {
    google()
    mavenCentral()
    jcenter()
}

Warning: jcenter() repository's already deprecated for Android development. The most ideal solution would be to look for some other similar library that offers support to mavenCentral() over one for avoiding deprecated repositories on your projects.

Reference:

  1. https://mvnrepository.com/artifact/com.mindorks.android/prdownloader?repo=jcenter

  2. JCenter deprecation; impact on Gradle and Android

Jorge Luiz
  • 281
  • 4
  • 10
  • 1
    It still doesn't work. It seems like it only works for jcenter repository and I use mavenCentral – Khumo Mashapa Jun 18 '22 at 11:30
  • 2
    I added to my answer how to add the *Jcenter repository* to your project. That should solve your issue. – Jorge Luiz Jun 19 '22 at 03:09
  • Thanks for the feedback it. I've marked as answer as acceptable. However I do have a question. There's news that the jcenter() will be shutdown. Will this not cause problems in the future? – Khumo Mashapa Jun 19 '22 at 13:34
  • 1
    [Yep, the most correct would be to not use this library but some other which offfers support to the *mavenCentral( ) repository* over jcenter( ). Because the latter's already *deprecated* for Android development.](https://stackoverflow.com/questions/66651640/jcenter-deprecation-impact-on-gradle-and-android) – Jorge Luiz Jun 19 '22 at 15:19
  • Thank you. By the looks of it I can still use jcenter until they move all the artifacts to mavenCentral. I really appreciate your help – Khumo Mashapa Jun 19 '22 at 15:30