You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After setup all the steps the exception is throw by the application (Crash log attached at the end).
This is happening after adding the below method to the base application class:
override fun getApplicationContext(): Context =
LocaleHelper.onAttach(super.getApplicationContext())
If this method is removed, app loads fine without any exception, but when the language from the Android Settings is changed, it doesn't reflect to the app. Have to close the app by swiping to get the changes.
Crash Log:
2021-08-03 16:54:43.585 25724-25724/com.universaltvplus.android E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.universaltvplus.android, PID: 25724
java.lang.RuntimeException: Unable to get provider androidx.lifecycle.ProcessLifecycleOwnerInitializer: java.lang.ClassCastException: android.app.ContextImpl cannot be cast to android.app.Application
at android.app.ActivityThread.installProvider(ActivityThread.java:8068)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7599)
at android.app.ActivityThread.handleMakeApplication(ActivityThread.java:7483)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7440)
at android.app.ActivityThread.access$1400(ActivityThread.java:301)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2148)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8506)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1139)
Caused by: java.lang.ClassCastException: android.app.ContextImpl cannot be cast to android.app.Application
at androidx.lifecycle.LifecycleDispatcher.init(LifecycleDispatcher.java:43)
at androidx.lifecycle.ProcessLifecycleOwnerInitializer.onCreate(ProcessLifecycleOwnerInitializer.java:36)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2429)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2399)
at android.app.ActivityThread.installProvider(ActivityThread.java:8063)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7599)
at android.app.ActivityThread.handleMakeApplication(ActivityThread.java:7483)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7440)
at android.app.ActivityThread.access$1400(ActivityThread.java:301)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2148)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8506)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1139)
The text was updated successfully, but these errors were encountered:
Android OS 11
Using (Option 2) Using delegates
After setup all the steps the exception is throw by the application (Crash log attached at the end).
This is happening after adding the below method to the base application class:
If this method is removed, app loads fine without any exception, but when the language from the Android Settings is changed, it doesn't reflect to the app. Have to close the app by swiping to get the changes.
Crash Log:
2021-08-03 16:54:43.585 25724-25724/com.universaltvplus.android E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.universaltvplus.android, PID: 25724
java.lang.RuntimeException: Unable to get provider androidx.lifecycle.ProcessLifecycleOwnerInitializer: java.lang.ClassCastException: android.app.ContextImpl cannot be cast to android.app.Application
at android.app.ActivityThread.installProvider(ActivityThread.java:8068)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7599)
at android.app.ActivityThread.handleMakeApplication(ActivityThread.java:7483)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7440)
at android.app.ActivityThread.access$1400(ActivityThread.java:301)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2148)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8506)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1139)
Caused by: java.lang.ClassCastException: android.app.ContextImpl cannot be cast to android.app.Application
at androidx.lifecycle.LifecycleDispatcher.init(LifecycleDispatcher.java:43)
at androidx.lifecycle.ProcessLifecycleOwnerInitializer.onCreate(ProcessLifecycleOwnerInitializer.java:36)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2429)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2399)
at android.app.ActivityThread.installProvider(ActivityThread.java:8063)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7599)
at android.app.ActivityThread.handleMakeApplication(ActivityThread.java:7483)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7440)
at android.app.ActivityThread.access$1400(ActivityThread.java:301)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2148)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8506)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1139)
The text was updated successfully, but these errors were encountered: