简体   繁体   English

错误 package androidx.recyclerview.widget 不存在 import androidx.recyclerview.widget.LinearLayoutManager;

[英]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 库的导入有关。

错误:包 androidx.recyclerview...

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 dependenciesdependencies {}中,我声明了以下依赖项

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.

相关问题 这是什么“RecyclerView 没有 LayoutManager androidx.recyclerview.widget.RecyclerView”错误? - What is this "RecyclerView has no LayoutManager androidx.recyclerview.widget.RecyclerView" error? void androidx.recyclerview.widget.RecyclerView.setLayoutManager(androidx.recyclerview.widget.RecyclerView$LayoutManager) 在 null object 参考 - void androidx.recyclerview.widget.RecyclerView.setLayoutManager(androidx.recyclerview.widget.RecyclerView$LayoutManager) on a null object reference 错误充气 class androidx.recyclerview.widget.RecycleView - Error inflating class androidx.recyclerview.widget.RecycleView RecyclerView.setAdapter(androidx.recyclerview.widget.RecyclerView 适配器适配器 - RecyclerView.setAdapter(androidx.recyclerview.widget.RecyclerView Adapter ADAPTER 无法实例化以下类: - androidx.recyclerview.widget.RecyclerView - The following classes could not be instantiated: - androidx.recyclerview.widget.RecyclerView 包 androidx.appcompat.widget 不存在 Android Studio - package androidx.appcompat.widget does not exist Android Studio androidx.cardview.widget.CardView 不能转换为 androidx.recyclerview.widget.RecyclerView - androidx.cardview.widget.CardView cannot be cast to androidx.recyclerview.widget.RecyclerView androidx.recyclerview.widget.RecyclerView 无法转换为 androidx.cardview.widget.CardView - 拖放 - androidx.recyclerview.widget.RecyclerView cannot be cast to androidx.cardview.widget.CardView - Drag and drop 如何将 androidx.recyclerview.widget.RecyclerView 与 tools:listitem 一起使用? - How to use androidx.recyclerview.widget.RecyclerView with tools:listitem? Mono.Linker.MarkException:错误处理方法:'System.Void AndroidX.RecyclerView.Widget.RecyclerView/LayoutManager - Mono.Linker.MarkException: Error processing method: 'System.Void AndroidX.RecyclerView.Widget.RecyclerView/LayoutManager
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM