0

I just started with the Build your first app tutorial from android.com but for some reason, the design view does not show anything I drag or drop to it. I've tried creating buttons, text, plaintext etc, all with no errors, however, I can only see it when I run the app. What am I missing?

Running Android studio 3.1.4 on Ubuntu 18.04.1 LTS.

This is my first time using it, and I searched for similar questions before posting and only found questions/answers that were not similar enough to my issue to be helpful. I have tried rebuilding and invalidating the cache/restart with no avail.

Here are some snaps:

Snap of studio enter image description here

Snap of emulator enter image description here

Last here is the activity_main.xml:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="@dimen/activity_horizontal_margin"
        android:layout_marginStart="@dimen/activity_horizontal_margin"
        android:layout_marginTop="@dimen/activity_vertical_margin"
        android:text="@string/title_home"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <android.support.design.widget.BottomNavigationView
        android:id="@+id/navigation"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="0dp"
        android:layout_marginStart="0dp"
        android:background="?android:attr/windowBackground"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:menu="@menu/navigation" />

    <EditText
        android:id="@+id/editText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textPersonName"
        android:text="KoDy Abbott"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</android.support.constraint.ConstraintLayout>

Please let me know if you need anything else to help answer my question. Thank you in advanced, hopefully it is something simple that I am overlooking but at this point its easier for me to ask then bang my head for another few hours.....

Roy Scheffers
  • 3,832
  • 11
  • 31
  • 36
Kody
  • 16
  • 3

2 Answers2

0

There is no error in your project but there are some bugs in the recent update of support libraries

Change support libraries version to 28.0.0-alpha1 and it will work all

implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support:design:28.0.0-alpha1'
5ec20ab0
  • 742
  • 6
  • 15
0

Other solutions is that you can find an image button on the up-left. Click it and you can find a option called "force to refresh layout", click it and you problem will be solved.

Danny Zhao
  • 314
  • 1
  • 3
  • 12