I'm not able to import RecyclerView & CardView although it seems very trivial. This is the relevant part from gradle.build
script:
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "23.0.0"
lintOptions {
abortOnError false
}
defaultConfig {
minSdkVersion 11
targetSdkVersion 21
versionCode 1
versionName "1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/../lib'
}
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.1'
compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.android.support:recyclerview-v7:21.0.+'
compile 'com.google.android.gms:play-services:7.8.+'
}
The sync & build tasks executes normally so it seems that the dependencies actually downloaded. And when in some activity I try to import android.support.v7.widget.RecyclerView;
it's not recognising the package.
Maybe it's SDK API versions issues? Note I need min 11 and target max 22.
Add recent recyclerview which is in your sdk. right click on app --> Open Module Settings --> Dependencies then on right side click on plus button. Add library dependency and search recyclerview and then add it.
Hope it will work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With