We load our own custom Unity activity com.appName.etc on Android, instead of using Unity's default activity com.unity3d.player.UnityPlayerActivity (see https://docs.unity3d.com/Manual/android-custom-activity.html). Upon attempting to load our app we get an exception.
It seems that the Unity activity name that the SpacesLauncher is pointing to is hard-coded to be com.unity3d.player.UnityPlayerActivity, is there a way to point that to our custom activity? I checked the SpacesController Android project, but I didn't see any way to change the target activity name. I assume this is coming from inside the library snapdragon-openxr-input-plugin-spaces-client-v0.9.7-release.aar
I'm not super experienced with Android build stuff, so I could have missed something.
ADB Stacktrace:
07-25 14:59:47.101 6246 6246 E AndroidRuntime: java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=42, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {com.appName.etc/com.qualcomm.snapdragon.spaces.unitycustomlauncher.SpacesLauncher}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.appName.etc/com.unity3d.player.UnityPlayerActivity}; have you declared this activity in your AndroidManifest.xml?
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.app.ActivityThread.deliverResults(ActivityThread.java:5455)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.app.ActivityThread.handleSendResult(ActivityThread.java:5494)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:54)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2321)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:111)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:238)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.os.Looper.loop(Looper.java:357)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:8099)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1026)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.appName.etc/com.unity3d.player.UnityPlayerActivity}; have you declared this activity in your AndroidManifest.xml?
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2179)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.app.Instrumentation.execStartActivity(Instrumentation.java:1812)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.app.Activity.startActivityForResult(Activity.java:5506)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.app.Activity.startActivity(Activity.java:5850)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at com.qualcomm.snapdragon.spaces.unitycustomlauncher.SpacesLauncher.startMainActivity(SpacesLauncher.java:185)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at com.qualcomm.snapdragon.spaces.unitycustomlauncher.SpacesLauncher.onRequestPermissionsResult(SpacesLauncher.java:144)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:8716)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.app.Activity.dispatchActivityResult(Activity.java:8573)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: at android.app.ActivityThread.deliverResults(ActivityThread.java:5448)
07-25 14:59:47.101 6246 6246 E AndroidRuntime: ... 13 more
1 Comment
S
Steve Lukas
said
over 2 years ago
This is not available at this time to define your own activity name, but a feature request has been filed.
Gordon Cooper
We load our own custom Unity activity com.appName.etc on Android, instead of using Unity's default activity com.unity3d.player.UnityPlayerActivity (see https://docs.unity3d.com/Manual/android-custom-activity.html). Upon attempting to load our app we get an exception.
It seems that the Unity activity name that the SpacesLauncher is pointing to is hard-coded to be com.unity3d.player.UnityPlayerActivity, is there a way to point that to our custom activity? I checked the SpacesController Android project, but I didn't see any way to change the target activity name. I assume this is coming from inside the library snapdragon-openxr-input-plugin-spaces-client-v0.9.7-release.aar
I'm not super experienced with Android build stuff, so I could have missed something.
ADB Stacktrace: