Unity_Android_Screen_Recorder icon indicating copy to clipboard operation
Unity_Android_Screen_Recorder copied to clipboard

Cant use on Oculus

Open uurha opened this issue 5 years ago • 6 comments

Hi. I'm tying to record screen data from Oculus but all time receiving errors, do you have any suggestions.

AndroidManifest.txt

This is a bit modified AndroidManifest.

uurha avatar Dec 10 '20 16:12 uurha

Also I use AndroidManifest from your project but it's not working ;-;

uurha avatar Dec 10 '20 19:12 uurha

Oculus sdk might override default Unity Activity thus cause this bug. I will take a look but it may take time.

thanh-nguyen-kim avatar Dec 13 '20 04:12 thanh-nguyen-kim

Hey! Any updates on this? I am also interested! Thanks!

eusebiu avatar Sep 02 '21 13:09 eusebiu

I was able to make it work on Oculus but it now gives me an exception when starting the service: Error Unity AndroidJavaException: java.lang.IllegalStateException: System services not available to Activities before onCreate() Error Unity java.lang.IllegalStateException: System services not available to Activities before onCreate() Error Unity at android.app.Activity.getSystemService(Activity.java:6655) Error Unity at com.setik.androidutils.AndroidUtils.startRecording(AndroidUtils.java:137)

The sample is assuming that the main Activity is the AndroidUtils one and parts of the code is using this assumption, like:

androidRecorder = unityClass.GetStatic<AndroidJavaObject>("currentActivity");
androidRecorder.Call("setUpSaveFolder","Tee");

Update: after renaming the main activity in the manifest com.setik.androidutils.AndroidUtils, I got this error: AndroidJavaException: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.systemui/com.android.systemui.media.MediaProjectionPermissionActivity}; have you declared this activity in your AndroidManifest.xml?

Apparently, the oculus android flavor handles these permissions differently (VR mode only). https://forums.oculusvr.com/t5/Oculus-Quest-Development/Problem-with-MediaProjection-and-permission-dialog/m-p/874818

eusebiu avatar Sep 02 '21 20:09 eusebiu

@eusebiu Did you able to record with audio ? I am looking for same ...

ti-hardikshah avatar Apr 05 '22 09:04 ti-hardikshah

Nope, gave up!

eusebiu avatar Apr 21 '22 20:04 eusebiu