CariusLars / ar_flutter_plugin

Flutter Plugin for AR (Augmented Reality) - Supports ARKit on iOS and ARCore on Android devices
MIT License
322 stars 233 forks source link

App crash #71

Open naveenbharadwaj19 opened 2 years ago

naveenbharadwaj19 commented 2 years ago

I know this crash has been fixed from #59 ,748691c92. Closing and opening the ar screen second time app gets crash .

Logs :

D/io.carius.lars.ar_flutter_plugin.AndroidARView(27771): onActivityStopped
I/FilePickerUtils(27771): Caching from URI: content://com.android.providers.downloads.documents/document/msf%3A29
2
D/io.carius.lars.ar_flutter_plugin.AndroidARView(27771): onActivityStarted
D/io.carius.lars.ar_flutter_plugin.AndroidARView(27771): onActivityResumed
I/native  (27771): I1222 15:52:04.847192   27771 camera_config_manager.cc:719] UpdateBugFixes on CameraConfigManager is unimplemented!
I/native  (27771): I1222 15:52:04.847241   27771 session.cc:1202] Entering Session::Resume.
I/native  (27771): I1222 15:52:04.852603   27771 estimator_impl.cc:721] Resetting motion tracking from user request.
I/native  (27771): I1222 15:52:04.858020   27771 session.cc:3330] Update Frame Delay to 0 frames.
I/native  (27771): I1222 15:52:04.858123   27771 android_sensors.cc:212] Starting thread.
I/native  (27771): I1222 15:52:04.862913   27771 logger.h:28] DataSourceMetrics: kStartImageSubSystem: 2.452828ms
I/native  (27771): I1222 15:52:04.862952   27771 session.cc:1390] Session::ResumeWithAnalytics returning OK.
D/io.carius.lars.ar_flutter_plugin.AndroidARView(27771): onActivityResumed
I/native  (27771): I1222 15:52:04.863401   27771 camera_config_manager.cc:719] UpdateBugFixes on CameraConfigManager is unimplemented!
I/native  (27771): I1222 15:52:04.863468   27771 session.cc:1202] Entering Session::Resume.
I/native  (27771): I1222 15:52:04.865397   27771 estimator_impl.cc:721] Resetting motion tracking from user request.
I/native  (27771): I1222 15:52:04.390889   28425 android_sensors.cc:51] Gyro min delay 10ms requesting 10ms
I/native  (27771): I1222 15:52:04.874503   27771 session.cc:3330] Update Frame Delay to 0 frames.
I/native  (27771): I1222 15:52:04.874590   27771 android_sensors.cc:212] Starting thread.
I/native  (27771): I1222 15:52:04.393453   28425 android_sensors.cc:51] Accel min delay 10ms requesting 10ms
I/native  (27771): I1222 15:52:04.879467   27771 logger.h:28] DataSourceMetrics: kStartImageSubSystem: 4.731486ms
I/native  (27771): I1222 15:52:04.879560   27771 session.cc:1390] Session::ResumeWithAnalytics returning OK.
D/FilePickerUtils(27771): File loaded and cached at:/data/user/0/com.cart.app/cache/file_picker/Duck.glb
I/native  (27771): I1222 15:52:04.881649   27771 session.cc:3330] Update Frame Delay to 0 frames.
D/eglCodecCommon(27771): setVertexArrayObject: set vao to 0 (0) 0 0
D/EGL_emulation(27771): eglCreateContext: 0xec07ec20: maj 3 min 0 rcv 3
D/FilePickerDelegate(27771): File path:[com.mr.flutter.plugin.filepicker.FileInfo@1207d4e]
I/native  (27771): I1222 15:52:04.669596   28427 android_sensors.cc:51] Gyro min delay 10ms requesting 10ms
I/native  (27771): I1222 15:52:04.671104   28427 android_sensors.cc:51] Accel min delay 10ms requesting 10ms
D/EGL_emulation(27771): eglMakeCurrent: 0xec07ec20: ver 3 0 (tinfo 0xd5bca860)
D/EGL_emulation(27771): eglMakeCurrent: 0xc1c6a340: ver 3 0 (tinfo 0xd5bca860)
D/AndroidRuntime(27771): Shutting down VM
E/AndroidRuntime(27771): FATAL EXCEPTION: main
E/AndroidRuntime(27771): Process: com.cart.app, PID: 27771
E/AndroidRuntime(27771): java.lang.NullPointerException
E/AndroidRuntime(27771):    at com.google.ar.sceneform.utilities.Preconditions.checkNotNull(SourceFile:3)
E/AndroidRuntime(27771):    at com.google.ar.sceneform.Scene.setUseHdrLightEstimate(SourceFile:101)
E/AndroidRuntime(27771):    at com.google.ar.sceneform.ArSceneView.updateNormalLightEstimate(SourceFile:204)
E/AndroidRuntime(27771):    at com.google.ar.sceneform.ArSceneView.updateLightEstimate(SourceFile:136)
E/AndroidRuntime(27771):    at com.google.ar.sceneform.ArSceneView.onBeginFrame(SourceFile:124)
E/AndroidRuntime(27771):    at com.google.ar.sceneform.SceneView.doFrameNoRepost(SourceFile:90)
E/AndroidRuntime(27771):    at com.google.ar.sceneform.SceneView.doFrame(SourceFile:86)
E/AndroidRuntime(27771):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:964)
E/AndroidRuntime(27771):    at android.view.Choreographer.doCallbacks(Choreographer.java:790)
E/AndroidRuntime(27771):    at android.view.Choreographer.doFrame(Choreographer.java:721)
E/AndroidRuntime(27771):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
E/AndroidRuntime(27771):    at android.os.Handler.handleCallback(Handler.java:883)
E/AndroidRuntime(27771):    at android.os.Handler.dispatchMessage(Handler.java:100)
E/AndroidRuntime(27771):    at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(27771):    at android.app.ActivityThread.main(ActivityThread.java:7356)
E/AndroidRuntime(27771):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(27771):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime(27771):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/CameraCaptureSession(27771): Session 0: Failed to create capture session; configuration failed
E/CameraCaptureSession(0)(27771): Failed to configure session.
E/ConfiguringCameraController(0)(27771): Capture session encountered error: CaptureSessionErrorEvent(type=DEVICE_ERROR)
W/CameraDevice(0)(27771): Device disconnected.
W/ClosingCameraController(0)(27771): Saw device error, nothing to be done since already closing: DeviceErrorEvent(errorType=ERROR_CAMERA_DISCONNECTED)
I/native  (27771): I1222 15:52:05.152975   28393 logger.h:28] DataSourceMetrics: kFirstGlCallback: 278.239156ms
I/native  (27771): I1222 15:52:04.928262   28126 timebase_helpers.cc:169] Timebase offset intialized to 0
I/native  (27771): I1222 15:52:04.928324   28126 logger.h:28] DataSourceMetrics: kFirstImageCallback: 53.578094ms
W/native  (27771): W1222 15:52:04.949572   28382 vio_initializer.cc:492] Dropped initialization window due to skip in data.
E/native  (27771): E1222 15:52:04.949599   28380 epipolar_self_consistency_metrics.cc:164] Failed to create pose node for current timestamp 16951286704780
I/native  (27771): I1222 15:52:04.950293   28384 data_manager.cc:157] Mapping backend detected fault.
I/native  (27771): I1222 15:52:04.950435   28384 data_manager.cc:159] Saving current map to map buffer.
I/native  (27771): I1222 15:52:04.950591   28384 data_manager.cc:165] Generated map # 0, ID d3bab492-0f27-2c7b-9a96-e0f4a219d1e8, non-marginalized keyframes 17, landmarks 0
W/native  (27771): W1222 15:52:05.251869   28386 motion_tracking_context.cc:1524] Unable to find measurements corresponding to VIO status at timestamp 16951604053780.
I/native  (27771): I1222 15:52:05.939667   28126 camera_timestamp_corrector.cc:251] IMU-camera rough initial offset for camera 0 initialized to -3307106649420
D/TransportRuntime.SQLiteEventStore(27771): Storing event with priority=HIGHEST, name=FIREBASE_CRASHLYTICS_REPORT for destination cct
I/native  (27771): I1222 15:52:05.561000   28428 performance_monitor.cc:115] Event: FeatureExtraction is taking too long, it took 291.518ms
D/TransportRuntime.JobInfoScheduler(27771): Scheduling upload for context TransportContext(cct, HIGHEST, MSRodHRwczovL2NyYXNobHl0aWNzcmVwb3J0cy1wYS5nb29nbGVhcGlzLmNvbS92MS9maXJlbG9nL2xlZ2FjeS9iYXRjaGxvZ1xBSXphU3lCcnBTWVQ0RkZMMDlyZUhKaTZIOUZZZGVpU25VVE92Mk0=) with jobId=638594704 in 1000ms(Backend next call timestamp 1640167576087). Attempt 1
I/Process (27771): Sending signal. PID: 27771 SIG: 9
Lost connection to device.

Note : Tested from example

Tested Android ✅ emulator ✅ physical

https://user-images.githubusercontent.com/63662884/147194844-83caa202-85f5-4b8e-8725-60061b43464c.mp4

Koobonik commented 2 years ago

I think you would better use my code : https://github.com/Koobonik/ar_flutter_plugin

It's helpful handle the session.

ar_flutter_plugin: git: path: ./ ref: develop url: git://github.com/Koobonik/ar_flutter_plugin

스크린샷 2021-12-23 오후 6 45 54

naveenbharadwaj19 commented 2 years ago

@Koobonik Still same issue but with different error log. Take a look on the video i've uploaded above⬆️

Log:

D/AndroidRuntime(17855): Shutting down VM
E/AndroidRuntime(17855): FATAL EXCEPTION: main
E/AndroidRuntime(17855): Process: com.cart.app, PID: 17855
E/AndroidRuntime(17855): java.lang.RuntimeException: Unable to resume activity {com.cart.app/com.cart.app.MainActivity}: java.lang.IllegalArgumentException
E/AndroidRuntime(17855):    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4205)
E/AndroidRuntime(17855):    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4237)
E/AndroidRuntime(17855):    at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
E/AndroidRuntime(17855):    at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
E/AndroidRuntime(17855):    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
E/AndroidRuntime(17855):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
E/AndroidRuntime(17855):    at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(17855):    at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(17855):    at android.app.ActivityThread.main(ActivityThread.java:7356)
E/AndroidRuntime(17855):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(17855):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime(17855):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/AndroidRuntime(17855): Caused by: java.lang.IllegalArgumentException
E/AndroidRuntime(17855):    at java.lang.reflect.Constructor.newInstance0(Native Method)
E/AndroidRuntime(17855):    at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
E/AndroidRuntime(17855):    at com.google.ar.core.Session.throwExceptionFromArStatus(Session.java:16)
E/AndroidRuntime(17855):    at com.google.ar.core.Session.nativeResume(Native Method)
E/AndroidRuntime(17855):    at com.google.ar.core.Session.resume(Session.java:1)
E/AndroidRuntime(17855):    at com.google.ar.sceneform.ArSceneView.resumeSession(SourceFile:56)
E/AndroidRuntime(17855):    at com.google.ar.sceneform.ArSceneView.resume(SourceFile:45)
E/AndroidRuntime(17855):    at io.carius.lars.ar_flutter_plugin.AndroidARView.onResume(AndroidARView.kt:436)
E/AndroidRuntime(17855):    at io.carius.lars.ar_flutter_plugin.AndroidARView$setupLifeCycle$1.onActivityResumed(AndroidARView.kt:354)
E/AndroidRuntime(17855):    at android.app.Application.dispatchActivityResumed(Application.java:436)
E/AndroidRuntime(17855):    at android.app.Activity.dispatchActivityResumed(Activity.java:1265)
E/AndroidRuntime(17855):    at android.app.Activity.onResume(Activity.java:1789)
E/AndroidRuntime(17855):    at io.flutter.embedding.android.FlutterActivity.onResume(FlutterActivity.java:569)
E/AndroidRuntime(17855):    at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1446)
E/AndroidRuntime(17855):    at android.app.Activity.performResume(Activity.java:7939)
E/AndroidRuntime(17855):    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4195)
E/AndroidRuntime(17855):    ... 11 more