Why android 5.0 occur error java.lang.RuntimeException: start smooth zoom failed? - android-camera

This is my code set zoom of camera:
// 10 Set zoom value to camera
if (p.isZoomSupported() && p.isSmoothZoomSupported()) {
// most phones
mCamera.startSmoothZoom(zoomvalue);
} else if (p.isZoomSupported() && !p.isSmoothZoomSupported()) {
p.setZoom(zoomvalue);
mCamera.setParameters(p);
mCamera.setParameters(p);
mCamera.startPreview();
}
But it occur exception on Canvas Spark (Q380) android 5.0:
java.lang.RuntimeException: start smooth zoom failed
at android.hardware.Camera.startSmoothZoom(Native Method)
jat android.app.Activity.dispatchTouchEvent(Activity.java:2775)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2326)
at android.view.View.dispatchPointerEvent(View.java:8687)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4485)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4343)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3884)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3937)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3903)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4013)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3911)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4070)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3884)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3937)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3903)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3911)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3884)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6300)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6256)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6209)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6462)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:176)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:6421)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:6493)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:795)
at android.view.Choreographer.doCallbacks(Choreographer.java:598)
at android.view.Choreographer.doFrame(Choreographer.java:565)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:781)
at android.os.Handler.handleCallback(Handler.java:810)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:189)
at android.app.ActivityThread.main(ActivityThread.java:5529)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
Why android 5.0 occur error java.lang.RuntimeException: start smooth zoom failed?

Related

Fatal exception : Couldn't inflate contentViewsjava.lang.IllegalArgumentException: setShowActionsInCompactView: action 0 out of bounds (max -1)

i use test lab to find bugs on my apps and i have an but that i can't find the origins. I think it came from just_audio or audio_service.
This is the test issues :
android.app.RemoteServiceException: Bad notification(tag=null, id=1124) posted from package com.our_unseen_nature, crashing app(uid=10274, pid=22490): Couldn't inflate contentViewsjava.lang.IllegalArgumentException: setShowActionsInCompactView: action 0 out of bounds (max -1)
FATAL EXCEPTION: main
Process: com.our_unseen_nature, PID: 22490
android.app.RemoteServiceException: Bad notification(tag=null, id=1124) posted from package com.our_unseen_nature, crashing app(uid=10274, pid=22490): Couldn't inflate contentViewsjava.lang.IllegalArgumentException: setShowActionsInCompactView: action 0 out of bounds (max -1)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2005)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7664)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Thank you everyone.
Thanks all, I've found the solution and It was really easy. The error occured because i didn't choose correctly the actions to show in Android's compact view based by those i've selected as my controls.
controls: [
MediaControl. skipToPrevious,
MediaControl.pause,
MediaControl.skipToNext,
],
// Which controls to show in Android's compact view
//from the lists of controls selected.
androidCompactActionIndices: const[0, 1, 2],

Flutter app login Exception has occurred. PlatformException error

I have a flutter app but every time I login I get an exception error and I have to press f5 to ensure the process is completed. This is the error
Exception has occurred.
PlatformException (PlatformException(error, Task io.flutter.plugins.sharedpreferences.MethodCallHandlerImpl$1#f33e5c6 rejected from java.util.concurrent.ThreadPoolExecutor#63f5987[Running, pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 0], null, java.util.concurrent.RejectedExecutionException: Task io.flutter.plugins.sharedpreferences.MethodCallHandlerImpl$1#f33e5c6 rejected from java.util.concurrent.ThreadPoolExecutor#63f5987[Running, pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 0]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2085)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:848)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1394)
at io.flutter.plugins.sharedpreferences.MethodCallHandlerImpl.commitAsync(MethodCallHandlerImpl.java:137)
at io.flutter.plugins.sharedpreferences.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:96)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:326)
at android.os.Looper.loop(Looper.java:165)
at android.app.ActivityThread.main(ActivityThread.java:6820)
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:922)
))
It seems the bug is fixed in shared_preferences 2.0.4 (at least for me it worked)
you should downgrade to
shared_preferences: 2.0.1
not
shared_preferences: ^2.0.1
if you used the beta version or use the stable version
shared_preferences: ^0.5.12+4

Flutter: Camera disconnect exception when other camera apps are opened

I'm currently using the flutter camera package to record and save videos, but I've noticed that the camera preview runs into an exception when the device's camera is opened on another app or when face unlock is used on the lock screen.
I've tried using didChangeAppLifecycleState to possibly fetch or reinitialize the camera, but there's no success yet.
await model.fetchCameras();
if (model.cameras.isNotEmpty) {
await model.onNewCameraSelected(model.cameras[model.cameraIndex], true);
}
}
This issue is currently opened here and here, but haven't been resolved.
I get this exception when the device's camera is opened in another app. I tried disposing the camera and reinitializing it in the sample code above, but it doesn't work.
E/CameraCaptureSession(31468): android.hardware.camera2.CameraAccessException: CAMERA_DISCONNECTED (2): cancelRequest:458: Camera device no longer alive
E/CameraCaptureSession(31468): at android.hardware.camera2.CameraManager.throwAsPublicException(CameraManager.java:814)
E/CameraCaptureSession(31468): at android.hardware.camera2.impl.ICameraDeviceUserWrapper.cancelRequest(ICameraDeviceUserWrapper.java:95)
E/CameraCaptureSession(31468): at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:1134)
E/CameraCaptureSession(31468): at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:526)
E/CameraCaptureSession(31468): at android.hardware.camera2.impl.CameraCaptureSessionImpl$2.onDisconnected(CameraCaptureSessionImpl.java:737)
E/CameraCaptureSession(31468): at android.hardware.camera2.impl.CameraDeviceImpl$7.run(CameraDeviceImpl.java:242)
E/CameraCaptureSession(31468): at android.os.Handler.handleCallback(Handler.java:873)
E/CameraCaptureSession(31468): at android.os.Handler.dispatchMessage(Handler.java:99)
E/CameraCaptureSession(31468): at android.os.Looper.loop(Looper.java:214)
E/CameraCaptureSession(31468): at android.app.ActivityThread.main(ActivityThread.java:6981)
E/CameraCaptureSession(31468): at java.lang.reflect.Method.invoke(Native Method)
E/CameraCaptureSession(31468): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/CameraCaptureSession(31468): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
E/CameraCaptureSession(31468): Caused by: android.os.ServiceSpecificException: cancelRequest:458: Camera device no longer alive (code 4)
E/CameraCaptureSession(31468): at android.os.Parcel.createException(Parcel.java:1980)
E/CameraCaptureSession(31468): at android.os.Parcel.readException(Parcel.java:1934)
E/CameraCaptureSession(31468): at android.os.Parcel.readException(Parcel.java:1884)
E/CameraCaptureSession(31468): at android.hardware.camera2.ICameraDeviceUser$Stub$Proxy.cancelRequest(ICameraDeviceUser.java:402)
E/CameraCaptureSession(31468): at android.hardware.camera2.impl.ICameraDeviceUserWrapper.cancelRe
Any Ideas, on how to force the camera package to reinitialize?
On resume re initialise Camera
#override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.resumed) {
_controller != null
? _initializeControllerFuture = _controller.initialize()
: null; //on pause camera is disposed, so we need to call again "issue is only for android"
}
}
checkout https://medium.com/#navinkumar0118/take-a-picture-using-flutter-camera-a9c11d282632

Android studio IDE internal error occurred Error says Unable to serialize DslActivationStatus state

1.Why Unable to serialize DslActivationStatus state happens
2. How to solve this error
3.I have provided screenshot of this error
Please look at the error screenshot
Unable to serialize DslActivationStatus state
com.intellij.util.xmlb.XmlSerializationException: Can't serialize instance of class org.jetbrains.plugins.groovy.dsl.DslActivationStatus$State
at com.intellij.configurationStore.XmlSerializer.serialize(xmlSerializer.kt:63)
at com.intellij.configurationStore.XmlSerializer.serialize$default(xmlSerializer.kt:47)
at com.intellij.configurationStore.SaveSessionBaseKt.serializeState(SaveSessionBase.kt:46)
at com.intellij.configurationStore.SaveSessionBase.setState(SaveSessionBase.kt:20)
at com.intellij.configurationStore.ComponentStoreImpl.commitComponent(ComponentStoreImpl.kt:283)
at com.intellij.configurationStore.ComponentStoreImpl.commitComponents$intellij_platform_configurationStore_impl(ComponentStoreImpl.kt:199)
at com.intellij.configurationStore.ComponentStoreWithExtraComponents.commitComponents$intellij_platform_configurationStore_impl(ComponentStoreWithExtraComponents.kt:89)
at com.intellij.configurationStore.ComponentStoreImpl.doCreateSaveSessionManagerAndCommitComponents$intellij_platform_configurationStore_impl(ComponentStoreImpl.kt:155)
at com.intellij.configurationStore.ComponentStoreImpl$createSaveSessionManagerAndSaveComponents$3.invokeSuspend(ComponentStoreImpl.kt:146)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:236)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:435)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:419)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:403)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:757)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:706)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:375)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: org.jdom.IllegalDataException: The data "org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
categoryTransformgdsl: 1: unexpected char: 0x0 # line 1, column 5.
����
In your function list you are calling the functions on list creation. This makes flutter throws this exception (which is correct because Navigator tries to route during the build phase of the other widget).
Apart from that, the code is quite weird to me but to get it to work you need to use this list:
final List<Function> ontaps = [
functionOne,
functionTwo,
functionThree,
functionFour,
functionFive,
functionSix,
functionSeven,
functionEight,
functionNine,
functionTen,
functionEleven,
functionTwelve,
functionThirteen,
functionFourteen,
functionFifteen
];

Spark cannot catch Size exceeds Integer.MAX_VALUE error exception?

I get this Exception while making repartition operation(decreasing partition size).
Caused by: java.lang.IllegalArgumentException: Size exceeds Integer.MAX_VALUE
While trying to catch this exception somehow below try-catch block doesn't work. It didn't catch the exception.
try{
someDF.repartition(10)
.persist(StorageLevel.MEMORY_AND_DISK)
.write.mode("overwrite").format(format).save(temp_location)
}
catch {
case ex: java.lang.IllegalArgumentException => {
// Do something else
}
But if I make exception type more generic it started to catch exception.
try{
someDF.repartition(10)
.persist(StorageLevel.MEMORY_AND_DISK)
.write.mode("overwrite").format(format).save(temp_location)
}
catch {
case ex: Exception => {
// Do something else
}
So what is the reason behind it?
Does spark somehow throw an other exception internally, different than written as error message?
Note "caused by" in the exception message; it means IllegalArgumentException is the cause of the exception and you should look at the stack trace before it for the exception class and message itself. It'll look like
Exception in thread "<thread-name>" <exception-class>: <message>
See also Setting Exception cause in java which gives this example stack trace:
Exception in thread "main" java.lang.RuntimeException: Some other message
at Exceptions.main(Exceptions.java:4)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.lang.RuntimeException: Some message
at Exceptions.main(Exceptions.java:3)
... 5 more