我在gradle中实现了PRDownloader.

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

但是,当我在适配器类中键入PRDownloader时,会出现错误"未知引用:PRDownloader".这是Android Studio给我的唯一错误.我用mavenCentral()而不是jcenter.也许这会引起一些问题.

推荐答案

没有0.6.0版本,最新版本是0.5.0.

将代码行修复为:

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

此外,在以下Gradle脚本build.gradle(Project: YOURPROJECTNAME)中,jcenter() repository in repositories语句:

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

Kotlin相关问答推荐

Kotlin-stdlib中的模拟扩展函数

如何更改默认推断没有接收者的函数类型?

为什么我的通用Kotlin函数中的这个转换未经判断?

如何访问嵌套在另一个 map 中的 map 中的值(在 kotlin 中)

Kotlin Path.useLines { } - 如何不获取 IOException("Stream closed")?

如何避免键盘打开时jetpack compose 内容上升

奇怪的 cotlin check Not Null 参数错误

parallelStream()和asSequence().asStream().parallel()之间的区别

Kotlin RxJava 可空的错误

如何将超过 2 个 api 调用的结果与 Coroutines Flow 结合起来?

jetpack compose 将参数传递给 viewModel

如何退出 Kotlinc 命令行编译器

防止导航到同一个片段

Android 与 Kotlin - 如何使用 HttpUrlConnection

Jetpack Compose-居中文本

类型不匹配:推断类型为 LoginActivity 但应为 LifecycleOwner

在Kotlin中使用@Service时引发异常

如何在使用Koin DI的活动之间共享同一个ViewModel实例?

如何在kotlin用mockito模仿lambda

如何在 kotlin 中创建重复对象数组?