camera2 api crashing on android 8.1.0 - android

I have used camera2 API to record the video, it is working absolutely fine but having problem only on android 8.1.0
throwing the following exception :
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'android.hardware.camera2.CaptureRequest android.hardware.camera2.impl.CameraDeviceImpl$CaptureCallbackHolder.getRequest(int)' on a null object reference
at android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onResultReceived(CameraDeviceImpl.java:1923)
at android.hardware.camera2.legacy.CameraDeviceUserShim$CameraCallbackThread$CallbackHandler.handleMessage(CameraDeviceUserShim.java:323)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:210)
at android.os.HandlerThread.run(HandlerThread.java:65)

Related

android(Flutter): camera not working in Android 11 MIUI 13. throwing CameraException(error, Attempt to invoke virtual method 'int android.hardware

Flutter camera not working throwing following exception
CameraException(error, Attempt to invoke virtual method 'int android.hardware.camera2.CameraCaptureSession.capture(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession$CaptureCallback, android.os.Handler)' on a null object reference). Error thrown CaptureImageCubit.
Even we tried using 'example_app' given by the flutter camera plugin on pub.dev. it's giving the same error
Note: The user is able to use his camera on other third-party devices

Unable to destroy activity Android: Google Play Console Error

I am trying to launch my app into Production on Google Playstore. I have used Flutter to create the app. But in the pre-launch report I am getting error:
Stacktrace:
java.lang.RuntimeException: Unable to destroy activity {com.stech.ebox_expenses/com.example.ebox_expenses.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.lifecycle.e.c(androidx.lifecycle.h)' on a null object reference
FATAL EXCEPTION: main
Process: com.stech.ebox_expenses, PID: 12391
java.lang.RuntimeException: Unable to destroy activity {com.stech.ebox_expenses/com.example.ebox_expenses.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.lifecycle.e.c(androidx.lifecycle.h)' on a null object reference
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4504)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4522)
at android.app.ActivityThread.-wrap5(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1697)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6647)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.lifecycle.e.c(androidx.lifecycle.h)' on a null object reference
at com.mr.flutter.plugin.filepicker.FilePickerPlugin.j(Unknown Source:21)
at com.mr.flutter.plugin.filepicker.FilePickerPlugin.e(Unknown Source:0)
at io.flutter.embedding.engine.c.h(Unknown Source:54)
at io.flutter.embedding.android.f.o(Unknown Source:58)
at io.flutter.embedding.android.e.G(Unknown Source:7)
at io.flutter.embedding.android.e.onDestroy(Unknown Source:11)
at android.app.Activity.performDestroy(Activity.java:7241)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1271)
at androidx.test.runner.MonitoringInstrumentation.callActivityOnDestroy(MonitoringInstrumentation.java:1)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4491)
... 9 more
I try to find anything discussing this and I found one Stackoverflow question which was recieved badly and downvoted; Here's a ref to the post. I am not to sure why this is happening and I am not sure whether it is external problem which I can fix or an internal bug.
When I downloaded the app from the Playstore when it was production, it displayed a white screen when I opened it and stayed like this. I am not sure if me getting this error is a result of that or not either.
Any help on the matter will be appreciated!
I have managed to fix both problems which I was having. I fixed the first problem of this error by updating file_picker library to version 2.10. The issue was fixed in version 2.0.12. I also fixed the second issue of the white screen in the app when it started by downgrading to: classpath 'com.android.tools.build:gradle:3.4.3'. Here's the reference to the post which helped me.

WallpaperManager crash in Unity Android Live Wallpaper

I'm trying to build a live wallpaper by linking Unity to Android. I keep getting this error which happens inside the android code WallpaperManager. Anyone has any clue what is going on?
I'm using Unity 2019.2.21f1 and compile using a Unity tool from Asset Store link
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.WallpaperManager.notifyPid(boolean, int, java.lang.String)' on a null object reference
at android.service.wallpaper.WallpaperService$Engine.attach(WallpaperService.java:1326)
at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:1732)
at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:44)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8019)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

ADAL Android library crash

The app crashes for most of the users after an update from the Play store.
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equalsIgnoreCase(java.lang.String)' on a null object reference
at com.microsoft.aad.adal.TokenCacheAccessor.isMultipleMRRTsMatchingGivenApp(SourceFile:440)
at com.microsoft.aad.adal.AcquireTokenSilentHandler.tryMRRT(SourceFile:268)
at com.microsoft.aad.adal.AcquireTokenSilentHandler.tryRT(SourceFile:216)
at com.microsoft.aad.adal.AcquireTokenSilentHandler.getAccessToken(SourceFile:114)
at com.microsoft.aad.adal.AcquireTokenRequest.tryAcquireTokenSilentLocally(SourceFile:499)
at com.microsoft.aad.adal.AcquireTokenRequest.acquireTokenSilentFlow(SourceFile:475)
at com.microsoft.aad.adal.AcquireTokenRequest.tryAcquireTokenSilent(SourceFile:379)
at com.microsoft.aad.adal.AcquireTokenRequest.performAcquireTokenRequest(SourceFile:358)
at com.microsoft.aad.adal.AcquireTokenRequest.access$200(SourceFile:57)
at com.microsoft.aad.adal.AcquireTokenRequest$1.run(SourceFile:131)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
ADAL library version - 3.0.2
It's known to the project developers as an error while using proguard/dexguard.
Sample issues:
- ADAL Plugin integration is crashing with proguard/dexguard
- Resiliency fix to not crash: Null Pointer Exception at isMultipleRTsMatchingGivenAppAndResource
- NullPointerException in isMultipleMRRTsMatchingGivenApp

NullPointer on toLowerCase but I don't use that method anywhere

I'm getting the following crash dump in Firebase Crash Reports:
Exception java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase(java.util.Locale)' on a null object reference
bnp.run (bnp.java:56)
java.lang.Thread.run (Thread.java:818)
The problem is that I don't use the String.toLowerCase() method anywhere in the project. In Android Studio, I did Edit->Find In Path for the method and got no results, however, it does appear 100+ times if I search in the libraries. But I cannot find the "bnp.java" anywhere.
Thanks for your help!
Edit: A previous crash report was not proguard-affected and revealed it may be due to google-play-services or Firebase. I only use gms:play-services-places and gms:play-services-auth in my app, along with many Firebase dependencies.
Exception java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase(java.util.Locale)' on a null object reference
bnp.run (:com.google.android.gms.DynamiteModulesC:56)
java.lang.Thread.run (Thread.java:818)
I can't comment yet, so I will post this as a possible solution, but this seems like an error on Google's side. Multiple people are reporting this crash on the exact same device with the exact same region. So it seems Google runs your app on a virtual or automated device and then that device crashes. This device seems to be a Nexus 5x with local us-US and API level 23.
Source: https://code.google.com/p/android/issues/detail?id=233549
I got this error when my code was trying to create a connection to certain amqp service using an invalid URL. Once I modified it to the proper value, the exception is gone. So check your code.
My app ran into a similar issue.
When launched in Stock android devices(Mi A1), the App crashed with " keeps stopping popup". The Crashlytics in Fabric reported it as the
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase(java.util.Locale)' on a null object reference
at bfx.run(:com.google.android.gms.dynamite_dynamitemodulesc#13452060#13.4.52 (040708-202483333):80)
at java.lang.Thread.run(Thread.java:818)
But when I checked the Pre-launch report of the Release management in Google Play Console, it showed that the app was crashing for Pixel & Pixel 2 for an entirely different reason. The issue shown was
FATAL EXCEPTION: main Process: in.quickall.quickall, PID: 8345
java.lang.RuntimeException: Unable to start activity ComponentInfo{in.quickall.quickall/in.quickall.quickall.Main.MainActivity}: android.content.res.Resources$NotFoundException: Drawable in.quickall.quickall:drawable/splash_screen with resource ID #0x7f0700c0
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
And the issue started from the APK version were I implemented the code (given below) to remove the white screen on launch.
<style name="SplashTheme" parent="AppTheme">
<item name="android:windowBackground">#drawable/splash_screen</item>
</style>
I removed this piece of code and now the Pre-launch report shows it as working fine in the Pixel devices.
Now the app launches correctly, but has to have the white screen at launch.

Categories

Resources