title: Why can't I see my design in XML Android Studio?
body: <p>I'm a beginner and after searching on the net for a long time I found no satisfactory and permanent solution.  </p>
  
  <p>The problem is I can't see my design in Android Studio 3.0.1.</p>
  
  <p>I get a screen like this:</p>
  
  <p><a href="https://i.stack.imgur.com/Fsd1L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fsd1L.png" alt="enter image description here"></a></p>
  
  <p><strong>My STYLE.XML code</strong></p>
  
  <pre><code>&lt;resources&gt;
  
      &lt;!-- Base application theme. --&gt;
      &lt;style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"&gt;
          &lt;!-- Customize your theme here. --&gt;
          &lt;item name="colorPrimary"&gt;@color/colorPrimary&lt;/item&gt;
          &lt;item name="colorPrimaryDark"&gt;@color/colorPrimaryDark&lt;/item&gt;
          &lt;item name="colorAccent"&gt;@color/colorAccent&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;style name="AppTheme.NoActionBar"&gt;
          &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
          &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /&gt;
  
      &lt;style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <p><strong>My CONTENT CONTACT.XML code</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      app:layout_behavior="@string/appbar_scrolling_view_behavior"
      tools:context="hk.ust.cse.comp107x.chatclient.Contacts"
      tools:showIn="@layout/activity_contacts"&gt;
  
      &lt;ListView
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:id="@+id/friendListView"
          android:layout_alignParentBottom="true"
          android:layout_centerHorizontal="true" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>My XML code:</strong> </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context="hk.ust.cse.comp107x.chatclient.ChatClient"&gt;
  
      &lt;LinearLayout
          android:orientation="horizontal"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_centerHorizontal="true"
          android:padding="5pt"
          android:id="@+id/linearLayout"
          android:background="#ffffff"
          android:layout_alignParentLeft="true"
          android:layout_alignParentRight="true"
          android:layout_margin="0pt"&gt;
  
          &lt;EditText
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:id="@+id/messageText"
              android:layout_gravity="bottom"
              android:layout_weight="1"
              android:hint="@string/messagehint" /&gt;
  
  
          &lt;ImageButton
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/sendButton"
              android:src="@drawable/ic_send_black_36dp"
              android:background="@android:drawable/btn_default_small" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:orientation="vertical"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_alignParentTop="true"
          android:layout_alignParentEnd="true"
          android:layout_above="@+id/linearLayout"
          android:padding="5pt"
          android:background="@null"&gt;
  
          &lt;android.support.v7.widget.RecyclerView
              android:id="@+id/messageList"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="@null"
              android:divider="@null"
              android:scrollbars="vertical"
              android:stackFromBottom="true"
              android:transcriptMode="alwaysScroll" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>My BUILD.GRADLE code (app)</strong></p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.3"
  
      defaultConfig {
          applicationId "myappID"
          minSdkVersion 18
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      androidTestCompile 'com.android.support.test:runner:0.4.1'
      // Set this dependency to use JUnit 4 rules
      androidTestCompile 'com.android.support.test:rules:0.4.1'
      // Set this dependency to build and run Espresso tests
      androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
      // Set this dependency to build and run UI Automator tests
      androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
      androidTestCompile 'com.android.support:support-annotations:23.4.0'
      // Optional -- Hamcrest library
      androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
      compile 'com.android.support:appcompat-v7:23.4.0'
      compile 'com.android.support:design:23.4.0'
      compile 'com.android.support:cardview-v7:23.4.0'
      compile 'com.android.support:recyclerview-v7:23.4.0'
  }
  </code></pre>
  
  <p><strong>My activity_contact.xml</strong> (maybe this is coordinator layout?)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      tools:context="hk.ust.cse.comp107x.chatclient.Contacts"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/toolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:background="?attr/colorPrimary"
              app:popupTheme="@style/AppTheme.PopupOverlay" /&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;include layout="@layout/content_contacts" /&gt;
  
      &lt;android.support.design.widget.FloatingActionButton
          android:id="@+id/fab"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="bottom|end"
          android:layout_margin="@dimen/fab_margin"
          android:src="@android:drawable/ic_input_add" /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>I don't think there's a problem with Java code as I took this from a Learning course that I enrolled in Recently.</p>
  
  <p>EDIT: NOW I CAN SEE MY LAYOUT BUT I HAVE A GRADLE PROJECT SYNC FAILED. APPRECIATE ANY HELP
  <a href="https://i.stack.imgur.com/yzCFW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yzCFW.png" alt="NEW SCREEN"></a> </p>
  
  <p>My New Gradle code - </p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.3"
  
      defaultConfig {
          applicationId "hk.ust.cse.comp107x.chatclient"
          minSdkVersion 18
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      androidTestCompile 'com.android.support.test:runner:0.4.1'
      // Set this dependency to use JUnit 4 rules
      androidTestCompile 'com.android.support.test:rules:0.4.1'
      // Set this dependency to build and run Espresso tests
      androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
      // Set this dependency to build and run UI Automator tests
      androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
      androidTestCompile 'com.android.support:support-annotations:23.4.0'
      // Optional -- Hamcrest library
      androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
      compile 'com.android.support:appcompat-v7:25.3.1'
      compile 'com.android.support:design:25.3.1'
      compile 'com.android.support:cardview-v7:23.4.0'
      compile 'com.android.support:recyclerview-v7:23.4.0'
  }
  </code></pre>