How to combine ScrollView with ConstraintLayout in Android?

Solution for How to combine ScrollView with ConstraintLayout in Android?
is Given Below:

I have made a game in Android which consists of a ConstraintLayout with a programmatically populated fixed-size GridLayout. Below the grid are some views to interact with the game.

I have wrapped the entire ConstraintLayout in a ScrollView and would like to add a TextView at the very bottom which will keep track of the game events, and should thus dynamically expand towards the bottom as the game proceeds.

As you can see, I created a test TextView, and you can see the outline outside the preview, but the ScrollView just won’t allow me to scroll to display it:

<ScrollView
    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:fillViewport="true">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/gameConstraintLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        tools:context=".activities.GameActivity">

        <androidx.gridlayout.widget.GridLayout
            android:id="@+id/grid"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:background="@drawable/rectangle_border"
            app:layout_constraintBottom_toTopOf="@id/grid_guideline"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"/>

        <androidx.constraintlayout.widget.Guideline
            android:id="@+id/grid_guideline"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:layout_constraintGuide_end="220dp"
            android:orientation="horizontal"/>

        <!-- I removed the code for the bottom views as it is useless -->

        <androidx.constraintlayout.widget.Guideline
            android:id="@+id/log_guideline"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:layout_constraintGuide_end="0dp"
            android:orientation="horizontal"/>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintTop_toBottomOf="@id/log_guideline"
            app:layout_constraintStart_toStartOf="parent"
            android:text="TESTnTESTnTESTnTESTnTESTnTESTnTEST"
            android:textSize="20sp"
            android:textColor="@color/black"/>

    </androidx.constraintlayout.widget.ConstraintLayout>

</ScrollView>

Layout preview

How can I solve this problem and make it so that the layout is scrollable to reach the TextView below?