title: Rendering issue in android studio android.support.design.widget.CoordinatorLayout
body: <p>Firstly, I am just starting android development so please bear with my lack of knowledge. </p>
  
  <p>Two things my gradle doesn't recognize </p>
  
  <blockquote>
    <p>testCompile 'junit:junit:4.12'</p>
  </blockquote>
  
  <p><a href="http://i.stack.imgur.com/88xAZ.png" rel="nofollow">L</a></p>
  
  <p>But If i highlight the <strong>junit</strong> code in gradle then the project builds fine. What is the reason for this and will this be a problem later on in the development cycle. How to fix if so. </p>
  
  <p>And my main function just doesn't recognize so many libraries.</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
  compileSdkVersion 23
  buildToolsVersion "23.0.1"
  
  defaultConfig {
      applicationId "com.mycompany.myfirstapp"
      minSdkVersion 8
      targetSdkVersion 23
      versionCode 1
      versionName "1.0"
  }
  buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'),                proguard-rules.pro'
          }
      }
  }
  
  dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  //  testCompile 'junit:junit:4.12'
  compile 'com.android.support:appcompat-v7:23.1.0'
  compile 'com.android.support:design:23.1.0'
  compile 'com.android.support:appcompat-v7:23.1.0'
  compile 'com.android.support:gridlayout-v7:23.1.0'
  }
  </code></pre>
  
  <p>Second thing, even with gradle building fine I have rendering issue and preview of the design wont render no matter what. I did try solutions like<br>
  changing APK,changing themes from projects, adding appcompat in dependencies (there was only one v7:23.1.0). Nothing really helped. How do I fix rendering problem and start working in android studio?</p>
  
  <pre><code> Rendering Problems The following classes could not be instantiated:
  - android.support.design.widget.AppBarLayout (Open Class, Show Exception,   Clear Cache)
  - android.support.design.widget.CoordinatorLayout (Open Class, Show Exception, Clear Cache)
   Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE  Exception Details     java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or   descendant) with the design library.   at   android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:34)     at android.support.design.widget.AppBarLayout.&lt;init&gt;(AppBarLayout.java:145)   at java.lang.reflect.Constructor.newInstance(Constructor.java:526)   at    android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:756)   at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)   at android.view.LayoutInflater.rInflate(LayoutInflater.java:728)   at   android.view.LayoutInflater.inflate(LayoutInflater.java:492)   at   android.view.LayoutInflater.inflate(LayoutInflater.java:373) Copy stack to   clipboard  The surrounding layout (@layout/activity_my) did not actually include  this layout. Remove tools:showIn=... from the root tag.  
  </code></pre>