Search code examples
android-studio-3.1.3

Why is my text from TextView not showing in the Preview of Android Studio?


I was trying the basic Hello World program on Android Studio. The "Hello World" text from TextView does not show on the Preview. Even if I change the Hello World to something else, I do not get it on screen. What am I doing wrong?

The Android Studio version is 3.1.3


Solution

  • The error can be fixed by the following steps:

    Go to GradleScripts (Top Left Corner)-> build.gradle(Module:app) -> in dependencies change

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

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

    Then press Sync Now in Top Right Corner(Download Updates if necessary)

    The Preview will start working.

    You can watch this video as well to fix the issue

    Video Link- https://www.youtube.com/watch?v=PBE6sBMYDH0

    You must also use Theme of IntelliJ(White Theme) as Dark Theme is having rendering issues.

    You can watch this video to see how to change Theme in Android Studio

    https://youtu.be/Vr6DCDuRBuE