'Android 11 - Layout populating in emulator but not on actual device

Image from the actual device

Image from the emulator

I have published a basic app on playstore. For the linear layout the first TextView is appearing blank only for android 11 SDK 30 for actual devices, I am not able to replicate the issue for emulator.

I have encountered this issue, with the most recent release. Before this, code was working fine.

Snippet from build.gradle :

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

defaultConfig {
    applicationId "com.soumyatik.application"
    minSdkVersion 16
    targetSdkVersion 30
    versionCode 8
    versionName "2.2.2"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Snippet from activity_main.xml

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

    
    <ScrollView
        android:layout_above="@id/main_ad_view"
        android:id="@+id/main_scroll_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/type_3">
                <TextView
                    android:text="@string/colors"
                    android:id="@+id/textView_colors"/>
            </FrameLayout>

            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/type_1">
                <TextView
              
                    android:id="@+id/textView_common_words"
                    android:text="@string/common_words"/>
            </FrameLayout>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source