[英]Error package androidx.recyclerview.widget does not exist import androidx.recyclerview.widget.LinearLayoutManager;
I am having an issue with running my app on Android Studio.我在 Android Studio 上运行我的应用程序时遇到问题。 This error shows on the Build Output.此错误显示在 Build Output 上。
error: package androidx.recyclerview.widget does not exist import androidx.recyclerview.widget.LinearLayoutManager;
How do I run this successfully?我如何成功运行它? The issue seems to be with imports from the Androidx libraries.问题似乎与从 Androidx 库的导入有关。
Solved it by declaring the recycler view Gradle dependency in Gradle Scripts>build.gradle.通过在 Gradle Scripts>build.gradle 中声明回收站视图 Gradle 依赖关系解决了这个问题。
Within dependencies {}
, I declared the following dependencies在dependencies {}
中,我声明了以下依赖项
implementation "androidx.recyclerview:recyclerview:1.1.0"
For control over item selection of both touch and mouse-driven selection用于控制触摸和鼠标驱动选择的项目选择
implementation "androidx.recyclerview:recyclerview-selection:1.1.0-rc01"
Source: Declaring dependencies来源: 声明依赖关系
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.