Once here with the same problem, first of all, pay attention to what Christer Noordwick commented:
Think it's a bug in the latest version of the tools: https://code.google.com/p/android/issues/detail?id=78090
We have the same thing in the designer, but this is normal when working. It worked without problems until the release of API level 21 SDK.
As I can see, you have 4 options:
Option 1: Go back to Android before 5.0 Use and compile your code using SDK 20
Change build.gradle to the following:
apply plugin: 'com.android.application' android { compileSdkVersion 20 buildToolsVersion "20.0.0" defaultConfig { applicationId "com.example.yourapp" minSdkVersion 8 targetSdkVersion 20 versionCode 1 versionName "1.0" } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:support-v4:20.0.0' }
change the following lines to what ever matched your project:
applicationId "com.example.yourapp" minSdkVersion 8
Most likely, you will also have to change the "res \ v21 \ styles.xml":
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="android:Theme.Material.Light"> </style> </resources>
in
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="android:Theme.Holo.Light"> </style> </resources>
How material topics are presented on Lollipop / Android 5.0
Synchronize your project with a new gradle file, wait for the synchronization to complete, and you will be fine, you should see a preview of the layout

Option 2: update your code in the text
The code will compile and work just fine, just update your code in the text, without previewing. Instead, make changes and try them on the emulator or on the Android device itself.
Option 3: combine the first 2 options
Use option 1, do what you need to do for layouts (if it doesn't need anything specific from SDK 21), and when done, revert the changes made to build.gradle and styles.xml so you can enjoy the new Lollipop eye candy, just test it on an emulator or device, as suggested on option 2
Option 4: wait to fix the error
just this.
Optional long shot option:
If you installed a stable build of Android Studio, try Beta or Canary, who knows, maybe there is a fix implemented to solve this problem on one of them (I have a stable build, so I don’t know). Or try Eclipse