5

enter image description here

XML CODE:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
tools:context=".MainActivity">

<TextView
    android:layout_width="34dp"
    android:layout_height="53dp"
    android:text="Hello World!"
    android:textAppearance="@style/TextAppearance.AppCompat"
    android:visibility="visible" />

</LinearLayout

Need help asap.What to do??

eyllanesc
  • 235,170
  • 19
  • 170
  • 241

3 Answers3

3

I had the same problem yesterday after updating android studio, Go to Gradle Scripts -> Build.Gradle(Module:app)

Gradle

change alpha3 to alpha1

        implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'

to

        implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'

Image

Note: [Edit] This solution doesn't work anymore as version codes have been updated, stable version has been released

Praveen G
  • 794
  • 1
  • 13
  • 24
1

Just building the project: Build -> Make Project

If that doesn't work try cleaning the project: Build -> Rebuild and Clean Project

That happened to me as well and all I had to do was build the project. Then it was able to render it.

-2

Use this code, it's working fine:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    tools:context=".MainActivity">

    <TextView
        android:layout_width="34dp"
        android:layout_height="53dp"
        android:text="Hello World!"
        android:textAppearance="@style/TextAppearance.AppCompat"
        android:visibility="visible" />

</LinearLayout>
Hemant N. Karmur
  • 840
  • 1
  • 7
  • 21