Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.android.gms.internal.zzewh.zzb(com.google.android.gms.internal.zzewx)' on a null object reference
at com.google.android.gms.internal.zzevz.zza(Unknown Source:154)
at com.google.android.gms.internal.zzevz.zzb(Unknown Source:78)
at com.google.android.gms.internal.zzevz.zza(Unknown Source)
at com.google.android.gms.internal.zzewc.run(Unknown Source:6)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Related
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findFocus()' on a null object reference
at android.view.ViewRootImpl.handleWindowFocusChanged(ViewRootImpl.java:3472)
at android.view.ViewRootImpl.access$1100(ViewRootImpl.java:205)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:5267)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:268)
at android.app.ActivityThread.main(ActivityThread.java:8023)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:635)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
mView.findFocus()
mView is DecorView
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.util.SparseArray.valueAt(int)' on a null object reference
at android.graphics.drawable.DrawableContainer$DrawableContainerState.createAllFutures(DrawableContainer.java:879)
at android.graphics.drawable.DrawableContainer$DrawableContainerState.getOpacity(DrawableContainer.java:1163)
at android.graphics.drawable.DrawableContainer.getOpacity(DrawableContainer.java:434)
at android.widget.ImageView.isOpaque(ImageView.java:1645)
at android.view.View.invalidateInternal(View.java:18603)
at android.view.View.invalidate(View.java:18582)
at android.view.View.invalidate(View.java:18564)
at android.widget.ImageView.setImageDrawable(ImageView.java:599)
at androidx.appcompat.widget.AppCompatImageView.setImageDrawable(AppCompatImageView.java:104)
at com.google.android.material.bottomnavigation.BottomNavigationItemView.setIcon(BottomNavigationItemView.java:408)
at com.google.android.material.bottomnavigation.BottomNavigationItemView.initialize(BottomNavigationItemView.java:146)
at com.google.android.material.bottomnavigation.BottomNavigationMenuView.updateMenuView(BottomNavigationMenuView.java:626)
at com.google.android.material.bottomnavigation.BottomNavigationPresenter.updateMenuView(BottomNavigationPresenter.java:69)
at androidx.appcompat.view.menu.MenuBuilder.dispatchPresenterUpdate(MenuBuilder.java:292)
at androidx.appcompat.view.menu.MenuBuilder.onItemsChanged(MenuBuilder.java:1063)
at androidx.appcompat.view.menu.MenuItemImpl.setIcon(MenuItemImpl.java:519)
at com.risor.ui.home.MainActivity$setUpProfileAvatar$1$onLoadFailed$1.run(MainActivity.kt:303)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7948)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:603)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'int android.content.pm.ApplicationInfo.flags' on a null object reference
at android.os.Parcel.createException(Parcel.java:1972)
at android.os.Parcel.readException(Parcel.java:1934)
at android.os.Parcel.readException(Parcel.java:1884)
at android.view.IWindowSession$Stub$Proxy.addToDisplay(IWindowSession.java:836)
at android.view.ViewRootImpl.setView(ViewRootImpl.java:926)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:390)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
at android.widget.Toast$TN.handleShow(Toast.java:525)
at android.widget.Toast$TN$1.handleMessage(Toast.java:429)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:226)
at android.app.ActivityThread.main(ActivityThread.java:7191)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:499)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942)
showing some fatal exception in IWindowSession.java line 836
android.view.IWindowSession$Stub$Proxy.addToDisplay please help to resolve it.
I'm using BiometricPrompt on my app but this code throws NullPointerException on some devices (for instance Redmi 5 Plus)
if (biometricManager.canAuthenticate() == BiometricManager.BIOMETRIC_SUCCESS) {
biometricPrompt.authenticate(getPromptInfo(), cryptoObject)
}
private fun getPromptInfo(): BiometricPrompt.PromptInfo {
return BiometricPrompt.PromptInfo.Builder()
.setTitle("My App's Authentication")
.setNegativeButtonText("Cancel")
.setSubtitle("Please login to get access")
.setDescription("My App is using Android biometric authentication")
.build()
}
Caused by:
java.lang.NullPointerException: Attempt to invoke virtual method 'void
android.widget.TextView.setVisibility(int)' on a null object reference
How can I fix this?
UPDATE (Added logs) :
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setVisibility(int)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2895)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setVisibility(int)' on a null object reference
at androidx.biometric.FingerprintDialogFragment.onCreateDialog(FingerprintDialogFragment.java:199)
at androidx.fragment.app.DialogFragment.onGetLayoutInflater(DialogFragment.java:419)
at androidx.fragment.app.Fragment.performGetLayoutInflater(Fragment.java:1484)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:320)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1187)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1356)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1434)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1497)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2625)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2577)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:247)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:541)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:210)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1335)
at android.app.Activity.performStart(Activity.java:7108)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2780)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2895)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
I'm new to Android and currently I have a thorny problem.
My application is crashed on MIUI9(Android 7.1.1), but it's working good on other device(Android N). I don't know how did it happend.
Below is the log:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.*****.***.***/com.*****.***.***.SplashActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Thread android.os.Looper.getThread()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2740)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2801)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1548)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6365)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:791)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Thread android.os.Looper.getThread()' on a null object reference
at miui.util.AttributeResolver.bR(SourceFile:35)
at miui.util.AttributeResolver.resolveInt(SourceFile:145)
at miui.util.AttributeResolver.isUsingMiuiTheme(SourceFile:179)
at miui.os.Environment.isUsingMiui(SourceFile:108)
at android.view.ViewConfigurationInjector.get(ViewConfigurationInjector.java:18)
at android.view.ViewConfiguration.get(ViewConfiguration.java:369)
at android.view.View.<init>(View.java:4028)
at android.view.View.<init>(View.java:4154)
at android.view.ViewGroup.<init>(ViewGroup.java:579)
at android.view.ViewGroup.<init>(ViewGroup.java:575)
at android.view.ViewGroup.<init>(ViewGroup.java:571)
at android.view.ViewGroup.<init>(ViewGroup.java:567)
at android.widget.FrameLayout.<init>(FrameLayout.java:78)
at com.android.internal.policy.DecorView.<init>(DecorView.java:237)
at com.android.internal.policy.PhoneWindow.generateDecor(PhoneWindow.java:2283)
at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2621)
at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:2049)
at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:371)
at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:320)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:272)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:148)
at cn.droidlover.xdroidmvp.mvp.XActivity.onCreate(XActivity.java:42)
at com.*****.***.***.BaseActivity.onCreate(BaseActivity.java:48)
at com.*****.***.***.SplashActivity.onCreate(SplashActivity.java:49)
at android.app.Activity.performCreate(Activity.java:6861)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2693)