Error inflating class android.support.v7.widget.FitWindowsFrameLayout

  android, android-studio, java, macos

I am new to android and learned basics .
When I was setting up an existing project on my android studio which is running on macos.
Build was successful , but when I tried running app, it started throwing exception.
Error inflating class android.support.v7.widget.FitWindowsFrameLayout

I found very few references to fix this issue , but nothing worked.
Could anyone please help me to fix this.
I can provide more information if required.


07/20 00:06:28: Launching 'app' on Nexus 6P API R.
$ adb shell am start -n "com.dealster.customer008/com.dealster.customer008.activities.SplashActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 4184 on device 'emulator-5554'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/ter.customer00: The ClassLoaderContext is a special shared library.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
I/MultiDex: VM with version 2.1.0 has multidex support
    Installing application
    VM has multidex support, MultiDex support library is disabled.
W/ter.customer00: Unsupported class loader
W/ter.customer00: Unsupported class loader
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
I/BiChannelGoogleApi: [FirebaseAuth: ] No Fallback module; NOT setting up for lazy initialization
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:3
    Selected remote version of com.google.android.gms.flags, version >= 3
I/FirebaseAuth: [FirebaseAuth:] Loading module via FirebaseOptions.
    [FirebaseAuth:] Preparing to create service connection to gms implementation
V/FA: Cancelling job. JobID: 1732972783
V/FA: Registered activity lifecycle callback
I/FirebaseInitProvider: FirebaseApp initialization successful
W/ter.customer00: Unsupported class loader
W/ter.customer00: Unsupported class loader
V/FA: Collection enabled
    App package, google app id: com.dealster.customer008, 1:472695003186:android:a8a3a2da1a65ed18b8442b
I/FA: App measurement is starting up, version: 11910
    To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
I/FA: To enable faster debug mode event logging run:
      adb shell setprop debug.firebase.analytics.app com.dealster.customer008
D/FA: Debug-level message logging enabled
W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
V/FA: Connecting to remote service
I/DynamiteModule: Considering local module com.google.android.gms.crash:0 and remote module com.google.android.gms.crash:215
I/DynamiteModule: Selected remote version of com.google.android.gms.crash, version >= 215
I/CrashlyticsCore: Initializing Crashlytics 2.6.3.25
V/FA: Connection attempt already in progress
I/FirebaseCrashApiImpl: FirebaseCrashApiImpl created by ClassLoader x[DexPathList[[zip file "/data/user_de/0/com.google.android.gms/app_chimera/m/00000004/DynamiteModulesC.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/00000004/n/x86, /data/user_de/0/com.google.android.gms/app_chimera/m/00000004/n/armeabi-v7a, /data/user_de/0/com.google.android.gms/app_chimera/m/00000004/n/armeabi, /system/lib, /system_ext/lib, /product/lib]]]
I/FirebaseCrash: FirebaseCrash reporting loaded - [email protected]
I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:3
    Selected remote version of com.google.android.gms.flags, version >= 3
W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
V/FA: onActivityCreated
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
W/ter.customer00: Accessing hidden field Landroid/view/LayoutInflater;->mConstructorArgs:[Ljava/lang/Object; (greylist-max-p, reflection, denied)
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.dealster.customer008, PID: 4184
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dealster.customer008/com.dealster.customer008.activities.SplashActivity}: android.view.InflateException: Binary XML file line #23 in com.dealster.customer008:layout/abc_screen_simple_overlay_action_mode: Binary XML file line #23 in com.dealster.customer008:layout/abc_screen_simple_overlay_action_mode: Error inflating class android.support.v7.widget.FitWindowsFrameLayout
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3333)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3477)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2043)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:216)
        at android.app.ActivityThread.main(ActivityThread.java:7464)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955)
     Caused by: android.view.InflateException: Binary XML file line #23 in com.dealster.customer008:layout/abc_screen_simple_overlay_action_mode: Binary XML file line #23 in com.dealster.customer008:layout/abc_screen_simple_overlay_action_mode: Error inflating class android.support.v7.widget.FitWindowsFrameLayout
     Caused by: android.view.InflateException: Binary XML file line #23 in com.dealster.customer008:layout/abc_screen_simple_overlay_action_mode: Error inflating class android.support.v7.widget.FitWindowsFrameLayout
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Field.get(java.lang.Object)' on a null object reference
        at uk.co.chrisjenx.calligraphy.ReflectionUtils.getValue(ReflectionUtils.java:29)
        at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.createCustomViewInternal(CalligraphyLayoutInflater.java:203)
        at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.access$000(CalligraphyLayoutInflater.java:20)
        at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater$PrivateWrapperFactory2.onCreateView(CalligraphyLayoutInflater.java:302)
        at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:237)
        at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1067)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:995)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:657)
        at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.inflate(CalligraphyLayoutInflater.java:60)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
        at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:427)
        at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:323)
        at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
        at android.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:303)
        at android.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:284)
        at com.dealster.customer008.base.BaseActivityLatest.onCreate(BaseActivityLatest.java:65)
        at android.app.Activity.performCreate(Activity.java:7990)
        at android.app.Activity.performCreate(Activity.java:7979)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3308)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3477)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2043)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:216)
        at android.app.ActivityThread.main(ActivityThread.java:7464)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955)
I/FirebaseCrashApiImpl: FirebaseCrash reporting API initialized
I/FirebaseCrash: FirebaseCrash reporting initialized [email protected]
D/FirebaseCrash: Firebase Analytics Listener for Firebase Crash is initialized
E/CrashlyticsCore: Failed to execute task.
    java.util.concurrent.TimeoutException
        at java.util.concurrent.FutureTask.get(FutureTask.java:206)
        at com.crashlytics.android.core.CrashlyticsBackgroundWorker.submitAndWait(CrashlyticsBackgroundWorker.java:41)
        at com.crashlytics.android.core.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:320)
        at com.crashlytics.android.core.CrashlyticsController$6.onUncaughtException(CrashlyticsController.java:300)
        at com.crashlytics.android.core.CrashlyticsUncaughtExceptionHandler.uncaughtException(CrashlyticsUncaughtExceptionHandler.java:42)
        at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
        at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
        at java.lang.Thread.dispatchUncaughtException(Thread.java:2203)
E/UncaughtException: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dealster.customer008/com.dealster.customer008.activities.SplashActivity}: android.view.InflateException: Binary XML file line #23 in com.dealster.customer008:layout/abc_screen_simple_overlay_action_mode: Binary XML file line #23 in com.dealster.customer008:layout/abc_screen_simple_overlay_action_mode: Error inflating class android.support.v7.widget.FitWindowsFrameLayout
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3333)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3477)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2043)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:216)
        at android.app.ActivityThread.main(ActivityThread.java:7464)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955)
     Caused by: android.view.InflateException: Binary XML file line #23 in com.dealster.customer008:layout/abc_screen_simple_overlay_action_mode: Binary XML file line #23 in com.dealster.customer008:layout/abc_screen_simple_overlay_action_mode: Error inflating class android.support.v7.widget.FitWindowsFrameLayout
     Caused by: android.view.InflateException: Binary XML file line #23 in com.dealster.customer008:layout/abc_screen_simple_overlay_action_mode: Error inflating class android.support.v7.widget.FitWindowsFrameLayout
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Field.get(java.lang.Object)' on a null object reference
        at uk.co.chrisjenx.calligraphy.ReflectionUtils.getValue(ReflectionUtils.java:29)
        at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.createCustomViewInternal(CalligraphyLayoutInflater.java:203)
        at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.access$000(CalligraphyLayoutInflater.java:20)
        at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater$PrivateWrapperFactory2.onCreateView(CalligraphyLayoutInflater.java:302)
        at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:237)
        at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1067)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:995)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:657)
        at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.inflate(CalligraphyLayoutInflater.java:60)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
        at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:427)
        at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:323)
        at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
        at android.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:303)
        at android.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:284)
        at com.dealster.customer008.base.BaseActivityLatest.onCreate(BaseActivityLatest.java:65)
        at android.app.Activity.performCreate(Activity.java:7990)
        at android.app.Activity.performCreate(Activity.java:7979)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3308)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3477)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2043)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:216)
        at android.app.ActivityThread.main(ActivityThread.java:7464)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955)
I/DynamiteModule: Considering local module com.google.android.gms.tagmanager:12 and remote module com.google.android.gms.tagmanager:215
    Selected remote version of com.google.android.gms.tagmanager, version >= 215
W/GoogleTagManager: No container asset found in /assets/containers. Checking top level /assets directory for container assets.
W/GoogleTagManager: Tag Manager's event handler WILL NOT be installed (no container loaded)
I/GoogleTagManager: Tag Manager initilization took 39ms
D/FA: Logging event (FE): app_exception(_ae), Bundle[{firebase_event_origin(_o)=crash, timestamp=1626732431166, fatal=1}]
W/ter.customer00: Accessing hidden method Lsun/misc/Unsafe;->objectFieldOffset(Ljava/lang/reflect/Field;)J (greylist,core-platform-api, linking, allowed)
W/ter.customer00: Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
W/ter.customer00: Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
W/ter.customer00: Accessing hidden method Lsun/misc/Unsafe;->allocateInstance(Ljava/lang/Class;)Ljava/lang/Object; (greylist, linking, allowed)
W/ter.customer00: Accessing hidden method Llibcore/io/Memory;->peekLong(JZ)J (greylist, reflection, allowed)
    Accessing hidden method Llibcore/io/Memory;->pokeLong(JJZ)V (greylist, reflection, allowed)
    Accessing hidden method Llibcore/io/Memory;->pokeInt(JIZ)V (greylist, reflection, allowed)
    Accessing hidden method Llibcore/io/Memory;->peekInt(JZ)I (greylist, reflection, allowed)
    Accessing hidden method Llibcore/io/Memory;->pokeByte(JB)V (greylist, reflection, allowed)
    Accessing hidden method Llibcore/io/Memory;->peekByte(J)B (greylist, reflection, allowed)
    Accessing hidden method Llibcore/io/Memory;->pokeByteArray(J[BII)V (greylist, reflection, allowed)
    Accessing hidden method Llibcore/io/Memory;->peekByteArray(J[BII)V (greylist, reflection, allowed)
W/ter.customer00: Accessing hidden method Lsun/misc/Unsafe;->arrayBaseOffset(Ljava/lang/Class;)I (greylist,core-platform-api, linking, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, linking, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->arrayIndexScale(Ljava/lang/Class;)I (greylist, linking, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
    Accessing hidden field Ljava/nio/Buffer;->address:J (greylist, reflection, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, reflection, allowed)
W/ter.customer00: Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, reflection, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, reflection, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, reflection, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, reflection, allowed)
V/FA: Connection attempt already in progress
I/FirebaseCrash: Sending crashes
I/Process: Sending signal. PID: 4184 SIG: 9

I tried to fix by below lines in proGuard-rules.pro in Gradele scripts

-keep public class android.support.v7.widget.FitWindowsFrameLayout
-dontwarn android.support.v7.widget.**

Below is mine bundle.grade(app) file.

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }

    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}



repositories {
    maven { url 'https://jitpack.io' }
    maven { url 'https://maven.fabric.io/public' }

}
android {
    compileSdkVersion 29
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "com.dealster.customer008"
        minSdkVersion 19
        targetSdkVersion 29
        versionCode 6
        versionName "1.0.6"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dataBinding {
        enabled = true
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'info.androidhive:barcode-reader:1.1.5'
    implementation 'com.nitscoder:spark:0.0.1_beta2'
    implementation 'com.android.support:design:26.0.0'
    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
    implementation 'com.google.code.gson:gson:2.6.2'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:support-annotations:28.0.0'
    implementation('io.socket:socket.io-client:1.0.0') {
        // excluding org.json which is provided by Android
        exclude group: 'org.json', module: 'json'
    }

    implementation 'com.google.firebase:firebase-core:11.8.0'
    implementation 'com.google.firebase:firebase-messaging:11.8.0'
    implementation 'com.android.installreferrer:installreferrer:2.1'

    implementation 'com.android.support:palette-v7:26.0.0'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.google.android.gms:play-services-auth:11.8.0'
    implementation "com.google.android.gms:play-services-location:11.8.0"
    implementation 'com.google.android.gms:play-services:11.8.0'
    implementation 'com.facebook.android:facebook-android-sdk:4.31.0'
    implementation 'com.google.maps:google-maps-services:0.1.20'
    implementation 'com.squareup.retrofit2:retrofit:2.1.0'
    implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
    implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
    implementation 'com.android.support:support-v4:26.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation('com.crashlytics.sdk.android:crashlytics:[email protected]') {
        transitive = true;
    }
    implementation project(':qrcodescanner')
}
apply plugin: 'com.google.gms.google-services'

Source: Android Questions

One Reply to “Error inflating class android.support.v7.widget.FitWindowsFrameLayout”

Leave a Reply to Arun sudharsan Cancel reply