1

After update android studio to 2.1 when I create project with basic activity then it shows me error like below. I tried to change android API and also change project theme in style.xml file,but still shows same error

enter image description here

mehrdad khosravi
  • 2,228
  • 9
  • 29
  • 34
Rizwan Ali
  • 23
  • 1
  • 5

3 Answers3

0

I guess you get this error because you haven't add support.design library to your project correctly. Doing these steps may solves your problem:

0- Change the target for the preview in the top right button of the preview area, like this:

enter image description here

1- Go to your SDK Manager and under the 'extras' section, check 'Android Support Library' and check it for installation. if you have done that before.

2- Add Support.design library to your build.gradle file:

compile 'com.android.support:design:24.1.0'

Then click "Synch Now" and gradle will get that library for you. then you can use support.design widgets in your UI.

3- Change res/values/styles.xml like this:

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar"/>
Milad Faridnia
  • 9,113
  • 13
  • 65
  • 78
0

I believe your SDK is not update correctly. Check again your SDK and download & install latest API correctly. for further detail check This post OR This One these both indicate the rendering problem solution.

Community
  • 1
  • 1
Inzimam Tariq IT
  • 6,548
  • 8
  • 42
  • 69
-2

Change the parent layout <CoordinatorLayout> to <LinearLayout> or <RelativeLayout>

will solve your problem

Amit Bhati
  • 1,405
  • 12
  • 20