When I try to use the RecyclerView in a test project when Im about to try out Android 5.0 Lollipop, I see the following on Googles site:
1) What puzzles me is that they use the support thing instead of the "real" thing as provided in API 21. I was expecting to not use the support-package as I am running 5.0 on the device, have SDK 21 downloaded and installed. Why cant I just use RecyclerView directly, without using the support...?
2) Classes could not be found In Android Studio, I get this error:
"Element RecyclerView is not allowed here" without further information. Also, if I use the example as posted above, I get the same error:
And if I click "Fix Build Path", I see:
I always have these problems using JAVA and Android, but the error messages are unclear. The path to the sdk is correct (under SDK Location).
This is my gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "se.snapcode.lollipoptest"
minSdkVersion 21
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
and this is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="se.snapcode.lollipoptest" >
<uses-sdk android:minSdkVersion="21"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>