shubham0204 / OnDevice-Face-Recognition-Android

On-device customizable face recognition in Android with FaceNet and an embedded vector database
https://medium.com/proandroiddev/building-on-device-face-recognition-in-android-076a40dbaac6
Apache License 2.0
39 stars 3 forks source link

Error: `java.lang.IllegalArgumentException: CreationExtras must have a value by SAVED_STATE_REGISTRY_OWNER_KEY` #3

Open sephiaz1 opened 2 months ago

sephiaz1 commented 2 months ago

I got this error when I try to launch it. What is the problem? Thanks.

java.lang.IllegalArgumentException: CreationExtras must have a value by SAVED_STATE_REGISTRY_OWNER_KEY at androidx.lifecycle.SavedStateHandleSupport.createSavedStateHandle(SavedStateHandleSupport.kt:89) at dagger.hilt.android.internal.lifecycle.HiltViewModelFactory$2.create(HiltViewModelFactory.java:101) at dagger.hilt.android.internal.lifecycle.HiltViewModelFactory.create(HiltViewModelFactory.java:171) at androidx.lifecycle.ViewModelProvider$Factory.create(ViewModelProvider.android.kt:158) at androidx.lifecycle.viewmodel.ViewModelProviderImpl.getViewModel$lifecycle_viewmodel_release(ViewModelProviderImpl.kt:69) at androidx.lifecycle.viewmodel.ViewModelProviderImpl.getViewModel$lifecycle_viewmodel_release$default(ViewModelProviderImpl.kt:47) at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.android.kt:91) at androidx.lifecycle.viewmodel.compose.ViewModelKtViewModelKt.get(ViewModel.kt:162) at androidx.lifecycle.viewmodel.compose.ViewModelKt.get(Unknown Source:1) at androidx.lifecycle.viewmodel.compose.ViewModelKtViewModel_androidKt.viewModel(ViewModel.android.kt:124) at androidx.lifecycle.viewmodel.compose.ViewModelKt.viewModel(Unknown Source:1) at com.ml.shubham0204.facenet_android.presentation.screens.detect_screen.DetectScreenKt.ScreenUI(DetectScreen.kt:221) at com.ml.shubham0204.facenet_android.presentation.screens.detect_screen.DetectScreenKt.access$ScreenUI(DetectScreen.kt:1) at com.ml.shubham0204.facenet_android.presentation.screens.detect_screen.ComposableSingletons$DetectScreenKt$lambda-4$1.invoke(DetectScreen.kt:99) at com.ml.shubham0204.facenet_android.presentation.screens.detect_screen.ComposableSingletons$DetectScreenKt$lambda-4$1.invoke(DetectScreen.kt:98) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:118) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.material3.ScaffoldKt$ScaffoldLayoutWithMeasureFix$1$1$bodyContentPlaceables$1.invoke(Scaffold.kt:303) at androidx.compose.material3.ScaffoldKt$ScaffoldLayoutWithMeasureFix$1$1$bodyContentPlaceables$1.invoke(Scaffold.kt:285) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$subcompose$3$1$1.invoke(SubcomposeLayout.kt:991) at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$subcompose$3$1$1.invoke(SubcomposeLayout.kt:477) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:90) at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3302) at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:3235) at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:725) at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:1071) at androidx.compose.runtime.ComposerImpl$CompositionContextImpl.composeInitial$runtime_release(Composer.kt:3599) at androidx.compose.runtime.CompositionImpl.composeInitial(Composition.kt:633) at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:619) at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.subcomposeInto(SubcomposeLayout.kt:500) at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.subcompose(SubcomposeLayout.kt:472) at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.subcompose(SubcomposeLayout.kt:463) at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.subcompose(SubcomposeLayout.kt:447) 2024-08-07 13:11:49.758 32650-32650 AndroidRuntime com.ml.shubham0204.facenet_android E at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$Scope.subcompose(SubcomposeLayout.kt:872) (Ask Gemini) at androidx.compose.material3.ScaffoldKt$ScaffoldLayoutWithMeasureFix$1$1.invoke-0kLqBqw(Scaffold.kt:285) at androidx.compose.material3.ScaffoldKt$ScaffoldLayoutWithMeasureFix$1$1.invoke(Scaffold.kt:179) at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$createMeasurePolicy$1.measure-3p2s80s(SubcomposeLayout.kt:709) at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.kt:126) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:252) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:251) at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2303) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:500) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:256) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133) at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(OwnerSnapshotObserver.kt:113) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:1617) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:36) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:620) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.measure-BRTryo0(LayoutNodeLayoutDelegate.kt:596) at androidx.compose.foundation.layout.BoxMeasurePolicy.measure-3p2s80s(Box.kt:122) at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.kt:126) at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.measure-3p2s80s(GraphicsLayerModifier.kt:646) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:116) at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.measure-3p2s80s(GraphicsLayerModifier.kt:646) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:116) at androidx.compose.foundation.layout.FillNode.measure-3p2s80s(Size.kt:699) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:116) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:252) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:251) at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2303) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:500) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:256) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133) at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(OwnerSnapshotObserver.kt:113) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:1617) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:36) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:620) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.measure-BRTryo0(LayoutNodeLayoutDelegate.kt:596) at androidx.compose.animation.AnimatedEnterExitMeasurePolicy.measure-3p2s80s(AnimatedVisibility.kt:851) at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.kt:126) 2024-08-07 13:11:49.763 32650-32650 AndroidRuntime com.ml.shubham0204.facenet_android E at androidx.compose.animation.EnterExitTransitionModifierNode.measure-3p2s80s(EnterExitTransition.kt:1156) (Ask Gemini) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:116) at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.measure-3p2s80s(GraphicsLayerModifier.kt:646) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:116) at androidx.compose.animation.AnimatedContentKt$AnimatedContent$6$1$1.invoke-3p2s80s(AnimatedContent.kt:733) at androidx.compose.animation.AnimatedContentKt$AnimatedContent$6$1$1.invoke(AnimatedContent.kt:732) at androidx.compose.ui.layout.LayoutModifierImpl.measure-3p2s80s(LayoutModifier.kt:294) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:116) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:252) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:251) at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2303) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:500) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:256) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133) at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(OwnerSnapshotObserver.kt:113) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:1617) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:36) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:620) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.measure-BRTryo0(LayoutNodeLayoutDelegate.kt:596) at androidx.compose.animation.AnimatedContentMeasurePolicy.measure-3p2s80s(AnimatedContent.kt:787) at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.kt:126) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:252) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:251) at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2303) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:500) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:256) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133) at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(OwnerSnapshotObserver.kt:113) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:1617) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:36) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:620) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.measure-BRTryo0(LayoutNodeLayoutDelegate.kt:596) at androidx.compose.ui.layout.RootMeasurePolicy.measure-3p2s80s(RootMeasurePolicy.kt:38) at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.kt:126) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:252) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:251) 2024-08-07 13:11:49.768 32650-32650 AndroidRuntime com.ml.shubham0204.facenet_android E at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2303) (Ask Gemini) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:500) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:256) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133) at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(OwnerSnapshotObserver.kt:113) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:1617) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:36) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:620) at androidx.compose.ui.node.LayoutNode.remeasure-_Sx5XlM$ui_release(LayoutNode.kt:1145) at androidx.compose.ui.node.MeasureAndLayoutDelegate.doRemeasure-sdFAvZA(MeasureAndLayoutDelegate.kt:354) at androidx.compose.ui.node.MeasureAndLayoutDelegate.remeasureOnly(MeasureAndLayoutDelegate.kt:562) at androidx.compose.ui.node.MeasureAndLayoutDelegate.measureOnly(MeasureAndLayoutDelegate.kt:407) at androidx.compose.ui.platform.AndroidComposeView.onMeasure(AndroidComposeView.android.kt:1058) at android.view.View.measure(View.java:27122) at androidx.compose.ui.platform.AbstractComposeView.internalOnMeasure$ui_release(ComposeView.android.kt:302) at androidx.compose.ui.platform.AbstractComposeView.onMeasure(ComposeView.android.kt:289) at android.view.View.measure(View.java:27122) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7008) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:27122) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7008) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1608) at android.widget.LinearLayout.measureVertical(LinearLayout.java:878) at android.widget.LinearLayout.onMeasure(LinearLayout.java:721) at android.view.View.measure(View.java:27122) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7008) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at com.android.internal.policy.DecorView.onMeasure(DecorView.java:750) at android.view.View.measure(View.java:27122) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:4182) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:2759) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3086) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2465) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9305) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1339) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1348) at android.view.Choreographer.doCallbacks(Choreographer.java:952) at android.view.Choreographer.doFrame(Choreographer.java:882) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1322) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294) at android.app.ActivityThread.main(ActivityThread.java:8177) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

shubham0204 commented 2 months ago

@sephiaz1 A similar issue was reported in another project on mine. Can you try adding the fragment-ktx dependency as mentioned in this comment?

https://github.com/google/dagger/issues/3484#issuecomment-1209599735

sephiaz1 commented 2 months ago

@shubham0204 thank you very much for the quick response. It does work, but seems like the face detector doesnt work. I could run the app, add face data, but when I hover it to someone's face, it doesnt work. I tried the other version of the face detector app and it worked fine.

sephiaz1 commented 2 months ago

image

sephiaz1 commented 2 months ago

This is the log if it could be any help 2024-08-07 14:51:03.331 20403-20769 CameraDevice-JV-0 com.ml.shubham0204.facenet_android W Device error received, code 4, frame number 37, request ID 0, subseq ID 0 2024-08-07 14:51:03.331 20403-20523 CameraStateRegistry com.ml.shubham0204.facenet_android D Recalculating open cameras: Camera State

                                                                                                Camera@cfdff2d[id=0]                         CLOSED                
                                                                                                Camera@420cae[id=1]                          PENDING_OPEN          
                                                                                                -------------------------------------------------------------------
                                                                                                Open count: 0 (Max allowed: 1)

2024-08-07 14:51:03.332 20403-20523 CameraStateMachine com.ml.shubham0204.facenet_android D New public camera state CameraState{type=CLOSED, error=null} from CLOSED and null 2024-08-07 14:51:03.332 20403-20523 CameraStateMachine com.ml.shubham0204.facenet_android D Publishing new public camera state CameraState{type=CLOSED, error=null} 2024-08-07 14:51:03.332 20403-20403 SurfaceViewImpl com.ml.shubham0204.facenet_android D Safe to release surface. 2024-08-07 14:51:03.332 20403-20516 Camera2CameraImpl com.ml.shubham0204.facenet_android D {Camera@420cae[id=1]} Attempting to open the camera. 2024-08-07 14:51:03.333 20403-20516 CameraStateRegistry com.ml.shubham0204.facenet_android D tryOpenCamera(Camera@420cae[id=1]) [Available Cameras: 1, Already Open: false (Previous state: PENDING_OPEN)] --> SUCCESS 2024-08-07 14:51:03.333 20403-20622 CameraDevice-JV-0 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 37, request ID 0, subseq ID 0 2024-08-07 14:51:03.333 20403-20622 CameraDevice-JV-0 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 37, request ID 0, subseq ID 0 2024-08-07 14:51:03.334 20403-20622 CameraDevice-JV-0 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 38, request ID 0, subseq ID 0 2024-08-07 14:51:03.335 20403-20769 CameraDevice-JV-0 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 38, request ID 0, subseq ID 0 2024-08-07 14:51:03.335 20403-20769 CameraDevice-JV-0 com.ml.shubham0204.facenet_android W Device error received, code 4, frame number 39, request ID 0, subseq ID 0 2024-08-07 14:51:03.335 20403-20769 CameraDevice-JV-0 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 39, request ID 0, subseq ID 0 2024-08-07 14:51:03.335 20403-20769 CameraDevice-JV-0 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 39, request ID 0, subseq ID 0 2024-08-07 14:51:03.336 20403-20516 CameraStateRegistry com.ml.shubham0204.facenet_android D Recalculating open cameras: Camera State

                                                                                                Camera@cfdff2d[id=0]                         CLOSED                
                                                                                                Camera@420cae[id=1]                          OPENING               
                                                                                                -------------------------------------------------------------------
                                                                                                Open count: 1 (Max allowed: 1)

2024-08-07 14:51:03.336 20403-20516 Camera2CameraImpl com.ml.shubham0204.facenet_android D {Camera@420cae[id=1]} Opening camera. 2024-08-07 14:51:03.336 20403-20516 Camera2CameraImpl com.ml.shubham0204.facenet_android D {Camera@420cae[id=1]} Transitioning camera internal state: PENDING_OPEN --> OPENING 2024-08-07 14:51:03.337 20403-20516 CameraStateMachine com.ml.shubham0204.facenet_android D New public camera state CameraState{type=OPENING, error=null} from OPENING and null 2024-08-07 14:51:03.337 20403-20516 UseCaseAttachState com.ml.shubham0204.facenet_android D All use case: [androidx.camera.core.Preview-82b46389-2d65-4539-8f7e-08867fd1da52217515392, androidx.camera.core.ImageAnalysis-ba87c6d2-05ed-4686-96b3-2300d6c56039165316537] for camera: 1 2024-08-07 14:51:03.340 20403-20516 libc com.ml.shubham0204.facenet_android W Access denied finding property "persist.vendor.camera.privapp.list" 2024-08-07 14:51:03.340 20403-20516 CameraExtImplXiaoMi com.ml.shubham0204.facenet_android D initCameraDevice: 1 2024-08-07 14:51:03.343 20403-20516 CameraManager com.ml.shubham0204.facenet_android I Open camera top activityName is com.ml.shubham0204.facenet_android.MainActivity 2024-08-07 14:51:03.364 20403-20403 CameraOrientationUtil com.ml.shubham0204.facenet_android D getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270 2024-08-07 14:51:03.371 20403-20516 Camera2CameraImpl com.ml.shubham0204.facenet_android D {Camera@420cae[id=1]} CameraDevice.onOpened() 2024-08-07 14:51:03.371 20403-20516 Camera2CameraImpl com.ml.shubham0204.facenet_android D {Camera@420cae[id=1]} Transitioning camera internal state: OPENING --> OPENED 2024-08-07 14:51:03.373 20403-20516 CameraStateRegistry com.ml.shubham0204.facenet_android D Recalculating open cameras: Camera State

                                                                                                Camera@cfdff2d[id=0]                         CLOSED                
                                                                                                Camera@420cae[id=1]                          OPEN                  
                                                                                                -------------------------------------------------------------------
                                                                                                Open count: 1 (Max allowed: 1)

2024-08-07 14:51:03.373 20403-20516 CameraStateMachine com.ml.shubham0204.facenet_android D New public camera state CameraState{type=OPEN, error=null} from OPEN and null 2024-08-07 14:51:03.373 20403-20516 CameraStateMachine com.ml.shubham0204.facenet_android D Publishing new public camera state CameraState{type=OPEN, error=null} 2024-08-07 14:51:03.374 20403-20516 UseCaseAttachState com.ml.shubham0204.facenet_android D All use case: [androidx.camera.core.Preview-82b46389-2d65-4539-8f7e-08867fd1da52217515392, androidx.camera.core.ImageAnalysis-ba87c6d2-05ed-4686-96b3-2300d6c56039165316537] for camera: 1 2024-08-07 14:51:03.375 20403-20516 SyncCaptureSessionBase com.ml.shubham0204.facenet_android D [androidx.camera.camera2.internal.SynchronizedCaptureSessionBaseImpl@110d91a] getSurface...done 2024-08-07 14:51:03.375 20403-20516 CaptureSession com.ml.shubham0204.facenet_android D Opening capture session. 2024-08-07 14:51:03.376 20403-20516 DeferrableSurface com.ml.shubham0204.facenet_android D use count+1, useCount=2 androidx.camera.core.SurfaceRequest$2@3df0757 2024-08-07 14:51:03.376 20403-20516 DeferrableSurface com.ml.shubham0204.facenet_android D New surface in use[total_surfaces=3, used_surfaces=2](androidx.camera.core.impl.ImmediateSurface@e96ceb0} 2024-08-07 14:51:03.377 20403-20516 DeferrableSurface com.ml.shubham0204.facenet_android D use count+1, useCount=1 androidx.camera.core.impl.ImmediateSurface@e96ceb0 2024-08-07 14:51:03.377 20403-20516 CameraDevice-JV-1 com.ml.shubham0204.facenet_android D waitUntilIdle: E. id = 1 2024-08-07 14:51:03.377 20403-20516 CameraDevice-JV-1 com.ml.shubham0204.facenet_android D waitUntilIdle: X 2024-08-07 14:51:03.447 20403-20516 CaptureSession com.ml.shubham0204.facenet_android D Attempting to send capture request onConfigured 2024-08-07 14:51:03.448 20403-20516 CaptureSession com.ml.shubham0204.facenet_android D Issuing request for session. 2024-08-07 14:51:03.448 20403-20516 Camera2Cap...estBuilder com.ml.shubham0204.facenet_android D createCaptureRequest 2024-08-07 14:51:03.449 20403-20516 CaptureSession com.ml.shubham0204.facenet_android D CameraCaptureSession.onConfigured() mState=OPENED 2024-08-07 14:51:03.450 20403-20516 CaptureSession com.ml.shubham0204.facenet_android D CameraCaptureSession.onReady() OPENED 2024-08-07 14:51:03.568 20403-20523 StreamStateObserver com.ml.shubham0204.facenet_android D Update Preview stream state to STREAMING 2024-08-07 14:51:03.644 20403-20516 Camera2CameraImpl com.ml.shubham0204.facenet_android D {Camera@420cae[id=1]} Use cases [androidx.camera.core.Preview-82b46389-2d65-4539-8f7e-08867fd1da52217515392, androidx.camera.core.ImageAnalysis-ba87c6d2-05ed-4686-96b3-2300d6c56039165316537] now DETACHED for camera 2024-08-07 14:51:03.645 20403-20516 UseCaseAttachState com.ml.shubham0204.facenet_android D All use case: [] for camera: 1 2024-08-07 14:51:03.645 20403-20516 Camera2CameraImpl com.ml.shubham0204.facenet_android D {Camera@420cae[id=1]} Resetting Capture Session 2024-08-07 14:51:03.646 20403-20516 Camera2CameraImpl com.ml.shubham0204.facenet_android D {Camera@420cae[id=1]} Releasing session in state OPENED 2024-08-07 14:51:03.646 20403-20516 UseCaseAttachState com.ml.shubham0204.facenet_android D Active and attached use case: [] for camera: 1 2024-08-07 14:51:03.647 20403-20516 UseCaseAttachState com.ml.shubham0204.facenet_android D Active and attached use case: [] for camera: 1 2024-08-07 14:51:03.647 20403-20516 Camera2CameraImpl com.ml.shubham0204.facenet_android D {Camera@420cae[id=1]} Closing camera. 2024-08-07 14:51:03.647 20403-20516 Camera2CameraImpl com.ml.shubham0204.facenet_android D {Camera@420cae[id=1]} Transitioning camera internal state: OPENED --> CLOSING 2024-08-07 14:51:03.648 20403-20516 CameraStateRegistry com.ml.shubham0204.facenet_android D Recalculating open cameras: Camera State

                                                                                                Camera@cfdff2d[id=0]                         CLOSED                
                                                                                                Camera@420cae[id=1]                          CLOSING               
                                                                                                -------------------------------------------------------------------
                                                                                                Open count: 1 (Max allowed: 1)

2024-08-07 14:51:03.648 20403-20516 CameraStateMachine com.ml.shubham0204.facenet_android D New public camera state CameraState{type=CLOSING, error=null} from CLOSING and null 2024-08-07 14:51:03.648 20403-20516 CameraStateMachine com.ml.shubham0204.facenet_android D Publishing new public camera state CameraState{type=CLOSING, error=null} 2024-08-07 14:51:03.648 20403-20516 Camera2CameraImpl com.ml.shubham0204.facenet_android D {Camera@420cae[id=1]} Resetting Capture Session 2024-08-07 14:51:03.648 20403-20516 Camera2CameraImpl com.ml.shubham0204.facenet_android D {Camera@420cae[id=1]} Releasing session in state CLOSING 2024-08-07 14:51:03.648 20403-20516 CaptureSession com.ml.shubham0204.facenet_android D onSessionFinished() 2024-08-07 14:51:03.648 20403-20516 CameraExtImplXiaoMi com.ml.shubham0204.facenet_android D releaseCameraDevice: 1 2024-08-07 14:51:03.653 20403-20516 CameraDevice-JV-1 com.ml.shubham0204.facenet_android D close: E. id = 1 2024-08-07 14:51:03.664 20403-20622 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 4, frame number 6, request ID 0, subseq ID 0 2024-08-07 14:51:03.687 20403-20403 WindowOnBackDispatcher com.ml.shubham0204.facenet_android W OnBackInvokedCallback is not enabled for the application. Set 'android:enableOnBackInvokedCallback="true"' in the application manifest. 2024-08-07 14:51:03.748 20403-20403 Compatibil...geReporter com.ml.shubham0204.facenet_android D Compat change id reported: 171228096; UID 10344; state: ENABLED 2024-08-07 14:51:03.760 20403-20516 CameraDevice-JV-1 com.ml.shubham0204.facenet_android D close: X 2024-08-07 14:51:03.761 20403-20516 UseCaseAttachState com.ml.shubham0204.facenet_android D Active and attached use case: [] for camera: 1 2024-08-07 14:51:03.764 20403-20516 DeferrableSurface com.ml.shubham0204.facenet_android D use count-1, useCount=1 closed=false androidx.camera.core.SurfaceRequest$2@3df0757 2024-08-07 14:51:03.764 20403-20516 DeferrableSurface com.ml.shubham0204.facenet_android D use count-1, useCount=0 closed=false androidx.camera.core.impl.ImmediateSurface@e96ceb0 2024-08-07 14:51:03.764 20403-20516 DeferrableSurface com.ml.shubham0204.facenet_android D Surface no longer in use[total_surfaces=3, used_surfaces=1](androidx.camera.core.impl.ImmediateSurface@e96ceb0} 2024-08-07 14:51:03.764 20403-20516 Camera2CameraImpl com.ml.shubham0204.facenet_android D {Camera@420cae[id=1]} CameraDevice.onClosed() 2024-08-07 14:51:03.764 20403-20516 Camera2CameraImpl com.ml.shubham0204.facenet_android D {Camera@420cae[id=1]} Transitioning camera internal state: CLOSING --> INITIALIZED 2024-08-07 14:51:03.765 20403-20516 CameraStateRegistry com.ml.shubham0204.facenet_android D Recalculating open cameras: Camera State

                                                                                                Camera@cfdff2d[id=0]                         CLOSED                
                                                                                                Camera@420cae[id=1]                          CLOSED                
                                                                                                -------------------------------------------------------------------
                                                                                                Open count: 0 (Max allowed: 1)

2024-08-07 14:51:03.766 20403-20516 CameraStateMachine com.ml.shubham0204.facenet_android D New public camera state CameraState{type=CLOSED, error=null} from CLOSED and null 2024-08-07 14:51:03.766 20403-20516 CameraStateMachine com.ml.shubham0204.facenet_android D Publishing new public camera state CameraState{type=CLOSED, error=null} 2024-08-07 14:51:03.766 20403-20622 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 4, frame number 5, request ID 0, subseq ID 0 2024-08-07 14:51:03.766 20403-20819 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 4, frame number 7, request ID 0, subseq ID 0 2024-08-07 14:51:03.766 20403-20819 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 3, request ID 0, subseq ID 0 2024-08-07 14:51:03.767 20403-20819 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 3, request ID 0, subseq ID 0 2024-08-07 14:51:03.767 20403-20819 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 4, frame number 3, request ID 0, subseq ID 0 2024-08-07 14:51:03.767 20403-20819 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 4, frame number 4, request ID 0, subseq ID 0 2024-08-07 14:51:03.767 20403-20819 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 4, request ID 0, subseq ID 0 2024-08-07 14:51:03.767 20403-21037 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 4, request ID 0, subseq ID 0 2024-08-07 14:51:03.767 20403-21037 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 5, request ID 0, subseq ID 0 2024-08-07 14:51:03.768 20403-21037 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 5, request ID 0, subseq ID 0 2024-08-07 14:51:03.770 20403-21037 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 6, request ID 0, subseq ID 0 2024-08-07 14:51:03.770 20403-21037 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 6, request ID 0, subseq ID 0 2024-08-07 14:51:03.770 20403-21037 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 7, request ID 0, subseq ID 0 2024-08-07 14:51:03.771 20403-21037 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 5, frame number 7, request ID 0, subseq ID 0 2024-08-07 14:51:03.771 20403-21037 CameraDevice-JV-1 com.ml.shubham0204.facenet_android W Device error received, code 3, frame number 8, request ID 0, subseq ID 0 2024-08-07 14:51:03.796 20403-20403 StreamStateObserver com.ml.shubham0204.facenet_android D Update Preview stream state to IDLE 2024-08-07 14:51:03.827 20403-20403 CameraOrientationUtil com.ml.shubham0204.facenet_android D getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270 2024-08-07 14:51:04.154 20403-20403 SurfaceViewImpl com.ml.shubham0204.facenet_android D Surface destroyed. 2024-08-07 14:51:04.154 20403-20403 SurfaceViewImpl com.ml.shubham0204.facenet_android D Surface closed androidx.camera.core.SurfaceRequest@f1168d6 2024-08-07 14:51:04.154 20403-20403 DeferrableSurface com.ml.shubham0204.facenet_android D surface closed, useCount=1 closed=true androidx.camera.core.SurfaceRequest$2@3df0757 2024-08-07 14:51:04.155 20403-20403 SurfaceView com.ml.shubham0204.facenet_android D UPDATE null, mIsCastMode = false 2024-08-07 14:51:04.156 20403-20403 SurfaceView com.ml.shubham0204.facenet_android D UPDATE null, mIsCastMode = false 2024-08-07 14:51:04.182 20403-20403 DeferrableSurface com.ml.shubham0204.facenet_android D surface closed, useCount=0 closed=true androidx.camera.core.processing.SurfaceEdge$SettableSurface@9c8fe7b 2024-08-07 14:51:04.182 20403-20403 DeferrableSurface com.ml.shubham0204.facenet_android D Surface terminated[total_surfaces=2, used_surfaces=1](androidx.camera.core.processing.SurfaceEdge$SettableSurface@9c8fe7b} 2024-08-07 14:51:04.182 20403-20403 DeferrableSurface com.ml.shubham0204.facenet_android D use count-1, useCount=0 closed=true androidx.camera.core.SurfaceRequest$2@3df0757 2024-08-07 14:51:04.182 20403-20403 DeferrableSurface com.ml.shubham0204.facenet_android D Surface no longer in use[total_surfaces=2, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@3df0757} 2024-08-07 14:51:04.182 20403-20403 DeferrableSurface com.ml.shubham0204.facenet_android D Surface terminated[total_surfaces=1, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@3df0757} 2024-08-07 14:51:04.182 20403-20403 SurfaceViewImpl com.ml.shubham0204.facenet_android D Safe to release surface. 2024-08-07 14:51:05.652 20403-20403 WindowOnBackDispatcher com.ml.shubham0204.facenet_android W OnBackInvokedCallback is not enabled for the application. Set 'android:enableOnBackInvokedCallback="true"' in the application manifest. 2024-08-07 14:51:05.748 20403-20403 facenet_android com.ml.shubham0204.facenet_android W type=1400 audit(0.0:143007): avc: denied { read } for name="u:object_r:vendor_display_prop:s0" dev="tmpfs" ino=16550 scontext=u:r:untrusted_app:s0:c88,c257,c512,c768 tcontext=u:object_r:vendor_display_prop:s0 tclass=file permissive=0 app=com.ml.shubham0204.facenet_android 2024-08-07 14:51:05.751 20403-20403 libc com.ml.shubham0204.facenet_android W Access denied finding property "vendor.display.enable_optimal_refresh_rate" 2024-08-07 14:51:05.760 20403-20459 OpenGLRenderer com.ml.shubham0204.facenet_android E Unable to match the desired swap behavior. 2024-08-07 14:51:05.772 20403-20403 VRI[MainActivity] com.ml.shubham0204.facenet_android D vri.reportNextDraw android.view.ViewRootImpl.performTraversals:4360 android.view.ViewRootImpl.doTraversal:2989 android.view.ViewRootImpl$TraversalRunnable.run:10304 android.view.Choreographer$CallbackRecord.run:1594 android.view.Choreographer$CallbackRecord.run:1603 2024-08-07 14:51:05.772 20403-20403 VRI[MainActivity] com.ml.shubham0204.facenet_android D vri.Setup new sync=wmsSync-VRI[MainActivity]#10 2024-08-07 14:51:05.778 20403-20459 OpenGLRenderer com.ml.shubham0204.facenet_android D makeCurrent grContext:0xb400007c228ef140 reset mTextureAvailable 2024-08-07 14:51:05.809 20403-20403 VRI[MainActivity] com.ml.shubham0204.facenet_android D vri.reportDrawFinished 2024-08-07 14:51:05.866 20403-20403 HandWritingStubImpl com.ml.shubham0204.facenet_android I refreshLastKeyboardType: 1 2024-08-07 14:51:05.866 20403-20403 HandWritingStubImpl com.ml.shubham0204.facenet_android I getCurrentKeyboardType: 1 2024-08-07 14:51:06.975 19465-20634 LauncherAnimationRunner com.mi.android.globallauncher E onAnimationStart: target=RemoteAnimationTargetCompat{taskId=19863, mode=1, isTranslucent=false, clipRect=Rect(0, 0 - 0, 0), position=Point(0, 0), sourceContainerBounds=Rect(0, 0 - 1080, 2400), prefixOrderIndex=3, isNotInRecents=false, contentInsets=Rect(0, 0 - 0, 0), activityType=1, packageName=com.ml.shubham0204.facenet_android, startBounds=Rect(0, 0 - 1080, 2400), windowType=-1} 2024-08-07 14:51:06.988 19465-20310 ActivityManagerWrapper com.mi.android.globallauncher E getRecentTasks: mainTaskId=19863 userId=0 windowMode=1 baseIntent=Intent { act=android.intent.action.MAIN flag=268435456 cmp=ComponentInfo{com.ml.shubham0204.facenet_android/com.ml.shubham0204.facenet_android.MainActivity} } 2024-08-07 14:51:07.014 19465-20310 ActivityManagerWrapper com.mi.android.globallauncher E getRecentTasks: mainTaskId=19863 userId=0 windowMode=1 baseIntent=Intent { act=android.intent.action.MAIN flag=268435456 cmp=ComponentInfo{com.ml.shubham0204.facenet_android/com.ml.shubham0204.facenet_android.MainActivity} }

shubham0204 commented 2 months ago

@sephiaz1 Which other version of the app you tried?

sephiaz1 commented 2 months ago

@sephiaz1 Which other version of the app you tried?

https://github.com/shubham0204/FaceRecognition_With_FaceNet_Android

That one

shubham0204 commented 2 months ago

@sephiaz1 I would have to reproduce the issue to fix it. I'll do it till this weekend, and check if we get a workaround (if you get one, do update it here on the issue)

sephiaz1 commented 2 months ago

@sephiaz1 I would have to reproduce the issue to fix it. I'll do it till this weekend, and check if we get a workaround (if you get one, do update it here on the issue)

Will try to do! Thanks you very much once again, sorry for the late response.

shubham0204 commented 2 months ago

@sephiaz1 I am trying to migrate to Koin for dependency injection. I'll push the code in another branch, and you can then build that project and see if you get any errors

sephiaz1 commented 2 months ago

@sephiaz1 I am trying to migrate to Koin for dependency injection. I'll push the code in another branch, and you can then build that project and see if you get any errors

Thank you, will take a look at it once its pushed.

shubham0204 commented 2 months ago

@sephiaz1 you can have a look now. Check the branch linked to PR #5

shubham0204 commented 2 months ago

@sephiaz1 you can have a look now. Check the branch linked to PR https://github.com/shubham0204/OnDevice-Face-Recognition-Android/pull/5

@sephiaz1 Could you confirm if migration to Koin resolved this issue completely?

Spriteing commented 2 months ago

Kotlin branch version the problem still exists,unable to perform facial recognition

Spriteing commented 2 months ago

5255da054415db35def554d83c825496 facelog.txt This is my log and video

shubham0204 commented 2 months ago

@Spriteing Could you send me the video at my email address panchalshubhamdev@gmail.com? Also, by Kotlin branch version do you mean the branch feature/koin?

Also, did the app prompt for the camera permission request and was it allowed by you?

Spriteing commented 2 months ago

@Spriteing Could you send me the video at my email address panchalshubhamdev@gmail.com? Also, by Kotlin branch version do you mean the branch feature/koin?

Also, did the app prompt for the camera permission request and was it allowed by you?

The video has been sent to your email. If you haven't received it, you can check the video I resubmitted here

https://github.com/user-attachments/assets/a69b3961-4544-4f6f-b566-5e961dd7984b