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
3 Answers
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:
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"/>

- 9,113
- 13
- 65
- 78
-
I already add this library " compile 'com.android.support:design:24.1.0' " .should I change that library to " compile 'com.android.support:design:23.0.0' " ? – Rizwan Ali Jul 24 '16 at 11:22
-
no it's ok. that is for version of your support library.Did you try synch and rebuild your project – Milad Faridnia Jul 24 '16 at 13:09
-
Thanks,problem solved by installing Android Support Library. – Rizwan Ali Jul 25 '16 at 12:30
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.

- 1
- 1

- 6,548
- 8
- 42
- 69
Change the parent layout
<CoordinatorLayout>
to <LinearLayout>
or <RelativeLayout>
will solve your problem

- 1,405
- 12
- 20