Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
paul3dvsl's avatar
paul3dvsl
Honored Guest
7 years ago

Oculus Go app doesn't properly quit via Home button

This seems to be a problem with all apps I've tried to build. Basically you exit the app via the Home button and select Quit. When you try and restart the app, it fails. It will however start on the second attempt.

Note that I'm using Unity 2018.1.0f2 (64 bit) on Windows, and this also happened with an app built using a totally unmodified Oculus Sample Framework project!

It appears that the app instance is not being destroyed on selecting Quit - when trying to restart the app the first time, adb reports that 'ActivityManager: Process com.company.appname (pid 1234) has died'. Other apps installed via the store don't have this issue - the process dies at the point of selecting Quit. The only hint I currently have at what's going on is the following output from adb when attempting to quit:
08-09 17:44:51.301 10079 10079 E ActivityThread: Activity com.unity3d.player.UnityPlayerActivity has leaked IntentReceiver com.oculus.vrapi.ScreenCaptureReceiver@220e616 that was originally registered here. Are you missing a call to unregisterReceiver()?
08-09 17:44:51.301 10079 10079 E ActivityThread: android.app.IntentReceiverLeaked: Activity com.unity3d.player.UnityPlayerActivity has leaked IntentReceiver com.oculus.vrapi.ScreenCaptureReceiver@220e616 that was originally registered here. Are you missing a call to unregisterReceiver()?
08-09 17:44:51.301 10079 10079 E ActivityThread: at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:1159)
08-09 17:44:51.301 10079 10079 E ActivityThread: at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:946)
08-09 17:44:51.301 10079 10079 E ActivityThread: at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1302)
08-09 17:44:51.301 10079 10079 E ActivityThread: at android.app.ContextImpl.registerReceiver(ContextImpl.java:1282)
08-09 17:44:51.301 10079 10079 E ActivityThread: at android.app.ContextImpl.registerReceiver(ContextImpl.java:1276)
08-09 17:44:51.301 10079 10079 E ActivityThread: at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:586)
08-09 17:44:51.301 10079 10079 E ActivityThread: at com.oculus.vrapi.ScreenCaptureReceiver.startReceiver(ScreenCaptureReceiver.java:185)
08-09 17:44:51.301 10079 10079 E ActivityThread: at com.oculus.vrapi.VrApi.onInitialize(VrApi.java:76)
08-09 17:44:51.301 10079 10079 E ActivityThread: at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
08-09 17:44:51.301 10079 10079 E ActivityThread: at com.unity3d.player.UnityPlayer.c(Unknown Source)
08-09 17:44:51.301 10079 10079 E ActivityThread: at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
08-09 17:44:51.301 10079 10079 E ActivityThread: at android.os.MessageQueue.next(MessageQueue.java:392)
08-09 17:44:51.301 10079 10079 E ActivityThread: at android.os.Looper.loop(Looper.java:136)
08-09 17:44:51.301 10079 10079 E ActivityThread: at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
08-09 17:44:51.304 10079 10079 E ActivityThread: Activity com.unity3d.player.UnityPlayerActivity has leaked IntentReceiver com.oculus.vrapi.SystemActivitiesReceiver@3afb184 that was originally registered here. Are you missing a call to unregisterReceiver()?
08-09 17:44:51.304 10079 10079 E ActivityThread: android.app.IntentReceiverLeaked: Activity com.unity3d.player.UnityPlayerActivity has leaked IntentReceiver com.oculus.vrapi.SystemActivitiesReceiver@3afb184 that was originally registered here. Are you missing a call to unregisterReceiver()?
08-09 17:44:51.304 10079 10079 E ActivityThread: at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:1159)
08-09 17:44:51.304 10079 10079 E ActivityThread: at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:946)
08-09 17:44:51.304 10079 10079 E ActivityThread: at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1302)
08-09 17:44:51.304 10079 10079 E ActivityThread: at android.app.ContextImpl.registerReceiver(ContextImpl.java:1282)
08-09 17:44:51.304 10079 10079 E ActivityThread: at android.app.ContextImpl.registerReceiver(ContextImpl.java:1276)
08-09 17:44:51.304 10079 10079 E ActivityThread: at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:586)
08-09 17:44:51.304 10079 10079 E ActivityThread: at com.oculus.vrapi.SystemActivitiesReceiver.startReceiver(SystemActivitiesReceiver.java:39)
08-09 17:44:51.304 10079 10079 E ActivityThread: at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
08-09 17:44:51.304 10079 10079 E ActivityThread: at com.unity3d.player.UnityPlayer.c(Unknown Source)
08-09 17:44:51.304 10079 10079 E ActivityThread: at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
08-09 17:44:51.304 10079 10079 E ActivityThread: at android.os.MessageQueue.next(MessageQueue.java:392)
08-09 17:44:51.304 10079 10079 E ActivityThread: at android.os.Looper.loop(Looper.java:136)
08-09 17:44:51.304 10079 10079 E ActivityThread: at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
Is this a problem anyone else has seen? All help gratefully received!

9 Replies

Replies have been turned off for this discussion
  • Experiencing same issue here. Also cuurrently using  Unity 2018.1.0f2 (64 bit) on Windows.
    I'm trying also trying to implement an OnApplicationQuit or OnDestroy method when quitting the app but seems to have no effect. Wondering if this may be the reason if the process doesn't die on quit.
  • I need to stay on 2018.1 for SDK compatibility reasons. Can you confirm if this issue is fixed in a later 2018.1 version? Thanks for any info
  • I had this issue on 2018.1.6f1, I switched to 2018.2.3f1 and the issue changed

    Before, when quitting via home button and reopening the app, the whole headset crashed

    Now, when I do so, first the app crashes, and when I open it again it works properly, I checked the RAM using adb, and I discovered that the app doesn't free the RAM when I close the app via home button, but after I reopen the app and it crashes the RAM is free...
    Have you ever heard of this @imperativity ?

    EDIT : my bad, the app I launched was the old one, my 2018.2.3f1 build didn't override the 2018.1.6f1 build
  • ctpeepee's avatar
    ctpeepee
    Honored Guest
    I'm having the exact same issue as described above except that I'm using Unreal not Unity. Game won't reopen after quitting and checking memory usage in adb shows the memory not being released. Also, checking the UE4 output (adb logcat -s UE4) is outputting the "Used memory: ..." message at regular intervals like it usually does when game still running.

    I am only getting this behaviour in one of my builds so am trying to figure out if there are any differences but thought I'd post to see if it's a known issue for unreal too?
  • The issue I have with the menu is regarding the resume button.  When clicking "resume" on the menu it just reloads the application from scratch, rather than jumping back into the app at the point it was exited.  

    I use:
    Unity 2018.2.20f1 
    Oculus Utilities for Unity 1.28.0 
    Oculus Integration 1.34.0

    Developer support team asked to see the android manifest file, could someone tell me what it is in this file which needs to be added / changed in order for the resume feature to work correctly?

    Help would really be appreciated!

    Thanks
  • Hi all, I'm running into a similar issue (though I will note that this thread is about an issue with `ScreenCaptureReceiver`, whereas mine is with `SystemActivitiesReceiver`). What was the fix that imperativity shared, paul3dvsl? It seems that they have since deleted their comment.

    For reference, I'm building a native app using OpenXR and seeing the following error on app shutdown. Like you, I'm not seeing the process being ended during app shutdown (I believe because of this error), which is leading to crashes when the app re-opens (in my case I have some code which I know can only run once per process, and I assume that `APP_CMD_DESTROY` will mean the process ends, which is not the case here). Like paul3dvsl saw though, it will start on the second attempt.

     

    ...Install and start the app:
    [AppLog] Process ID: 1495
    ...
    ...App runs...
    ...I click the menu, and then click Quit:
    [AppLog] APP_CMD_TERM_WINDOW
    [AppLog] APP_CMD_STOP
    [AppLog] APP_CMD_DESTROY
    --------- beginning of system
    02-26 12:46:18.511 10811 10811 E ActivityThread: Activity android.app.NativeActivity has leaked IntentReceiver com.oculus.vrapi.SystemActivitiesReceiver@e1f617 that was originally registered here. Are you missing a call to unregisterReceiver()?
    02-26 12:46:18.511 10811 10811 E ActivityThread: android.app.IntentReceiverLeaked: Activity android.app.NativeActivity has leaked IntentReceiver com.oculus.vrapi.SystemActivitiesReceiver@e1f617 that was originally registered here. Are you missing a call to unregisterReceiver()?
    02-26 12:46:18.511 10811 10811 E ActivityThread:        at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:1754)
    02-26 12:46:18.511 10811 10811 E ActivityThread:        at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:1531)
    02-26 12:46:18.511 10811 10811 E ActivityThread:        at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1766)
    02-26 12:46:18.511 10811 10811 E ActivityThread:        at android.app.ContextImpl.registerReceiver(ContextImpl.java:1732)
    02-26 12:46:18.511 10811 10811 E ActivityThread:        at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:738)
    02-26 12:46:18.511 10811 10811 E ActivityThread:        at com.oculus.vrapi.SystemActivitiesReceiver.startReceiver(:34)
    
    ...Now I start the app again:
    [AppLog] Process ID: 1495
    [AppLog] APP_CMD_START
    [AppLog] APP_CMD_RESUME
    [AppLog] APP_CMD_INIT_WINDOW
    ...App crashes because it is the same process as before...

     

     Note that I've also checked with `adb shell ps -A -o pid,user,stat,command` and can see that the process does not exit after `APP_CMD_DESTROY`, perhaps because of the leaked intent error?

    So, my question: does anyone have suggestions on fixing this error? Thank you for any help!