Can't use RecyclerView in my android library project
I have an Android library project and want to include a class that extends RecyclerView.Adapter
. My file build.gradle
contains the following:
apply plugin: 'com.android.library'
dependencies {
compile 'com.android.support:recyclerview-v7:21.0.+'
}
Regardless, I cannot import the RecyclerView into any java file; it doesn't even show up in the code completion popup in Android Studio (Control + Space). What's wrong?
+3
source to share
2 answers
I faced the same problem. Unfortunately, your accepted answer didn't work for me. what i did was ---- went to my gradle library file ( build.gradle (Modules: youLibraryname) ) and added the classpath for the RecyclerView. Something like that,
dependencies{
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
}
Hope this helps someone! :)
0
source to share