Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on MonitorActivity Resume #313

Closed
archie94 opened this issue Jun 29, 2018 · 5 comments
Closed

Crash on MonitorActivity Resume #313

archie94 opened this issue Jun 29, 2018 · 5 comments

Comments

@archie94
Copy link
Collaborator

Crashlog

/org.havenapp.main E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.havenapp.main, PID: 26670
    java.lang.RuntimeException: Unable to resume activity {org.havenapp.main/org.havenapp.main.MonitorActivity}: java.lang.IllegalArgumentException: Service not registered: org.havenapp.main.sensors.motion.Preview$1@dff8af1
        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3450)
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3490)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1540)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6165)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
     Caused by: java.lang.IllegalArgumentException: Service not registered: org.havenapp.main.sensors.motion.Preview$1@dff8af1
        at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1298)
        at android.app.ContextImpl.unbindService(ContextImpl.java:1483)
        at android.content.ContextWrapper.unbindService(ContextWrapper.java:648)
        at org.havenapp.main.sensors.motion.Preview.stopCamera(Preview.java:402)
        at org.havenapp.main.ui.CameraFragment.stopCamera(CameraFragment.java:68)
        at org.havenapp.main.ui.CameraFragment.resetCamera(CameraFragment.java:75)
        at org.havenapp.main.ui.CameraFragment.onResume(CameraFragment.java:62)
        at android.support.v4.app.Fragment.performResume(Fragment.java:2387)
        at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1467)
        at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1752)
        at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1821)
        at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3251)
        at android.support.v4.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:3215)
        at android.support.v4.app.FragmentController.dispatchResume(FragmentController.java:217)
        at android.support.v4.app.FragmentActivity.onResumeFragments(FragmentActivity.java:509)
        at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:498)
        at android.support.v7.app.AppCompatActivity.onPostResume(AppCompatActivity.java:171)
        at android.app.Activity.performResume(Activity.java:6815)
        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3427)
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3490) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1540) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:154) 
        at android.app.ActivityThread.main(ActivityThread.java:6165) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778) 
@n8fr8 n8fr8 added this to the Current Sprint milestone Jul 2, 2018
@lukeswitz
Copy link
Collaborator

To replicate:

  • MonitorActivity > Settings > Camera Sensitivity > Settings > MonitorActivity

@n8fr8
Copy link
Member

n8fr8 commented Jul 6, 2018

Should be fixed in 0.2.0 alpha 2

@n8fr8 n8fr8 closed this as completed Jul 6, 2018
@lukeswitz
Copy link
Collaborator

lukeswitz commented Jul 6, 2018

Works the first go, then after accessing sensitivity from settings:
07-06 08:48:00.266 2893-2893/org.havenapp.main E/AndroidRuntime: FATAL EXCEPTION: main Process: org.havenapp.main, PID: 2893 java.lang.RuntimeException: Unable to resume activity {org.havenapp.main/org.havenapp.main.ui.CameraConfigureActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.hardware.Camera.startPreview()' on a null object reference at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2986) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3017) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392) at android.app.ActivityThread.access$800(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) 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:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.hardware.Camera.startPreview()' on a null object reference at com.google.android.cameraview.Camera1.start(Camera1.java:113) at com.google.android.cameraview.CameraView.start(CameraView.java:282) at org.havenapp.main.sensors.motion.CameraViewHolder.startCamera(CameraViewHolder.java:217) at org.havenapp.main.ui.CameraFragment.initCamera(CameraFragment.java:118) at org.havenapp.main.ui.CameraFragment.onResume(CameraFragment.java:67) at android.support.v4.app.Fragment.performResume(Fragment.java:2390) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1474) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1759) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1827) at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3244) at android.support.v4.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:3212) at android.support.v4.app.FragmentController.dispatchResume(FragmentController.java:217) at android.support.v4.app.FragmentActivity.onResumeFragments(FragmentActivity.java:509) at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:498) at android.support.v7.app.AppCompatActivity.onPostResume(AppCompatActivity.java:171)

Then crashes when resuming from monitor > sensitivity > monitor:
07-06 08:51:14.801 2987-2987/org.havenapp.main E/AndroidRuntime: FATAL EXCEPTION: main Process: org.havenapp.main, PID: 2987 java.lang.RuntimeException: Unable to resume activity {org.havenapp.main/org.havenapp.main.MonitorActivity}: java.lang.RuntimeException: startPreview failed at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2986) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3017) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1347) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) 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:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: java.lang.RuntimeException: startPreview failed at android.hardware.Camera.startPreview(Native Method) at com.google.android.cameraview.Camera1.start(Camera1.java:113) at com.google.android.cameraview.CameraView.start(CameraView.java:274) at org.havenapp.main.sensors.motion.CameraViewHolder.startCamera(CameraViewHolder.java:217) at org.havenapp.main.ui.CameraFragment.initCamera(CameraFragment.java:118) at org.havenapp.main.ui.CameraFragment.resetCamera(CameraFragment.java:84) at org.havenapp.main.ui.CameraFragment.onResume(CameraFragment.java:69) at android.support.v4.app.Fragment.performResume(Fragment.java:2390) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1474) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1759) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1827) at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3244) at android.support.v4.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:3212) at android.support.v4.app.FragmentController.dispatchResume(FragmentController.java:217) at android.support.v4.app.FragmentActivity.onResumeFragments(FragmentActivity.java:509) at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:498) at android.support.v7.app.AppCompatActivity.onPostResume(AppCompatActivity.java:171) at android.app.Activity.performResume(Activity.java:6089)

@n8fr8
Copy link
Member

n8fr8 commented Jul 6, 2018

Appreciate the logs!

@lukeswitz
Copy link
Collaborator

The least I could do; Impressive sprint! This is looking excellent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants