Forum Discussion
jboss
10 years agoProtege
Android Manifest set activity
I am trying to get my Gear VR app ready for the Ocuus store by updating the AndroidManifest file according to the documentation here https://developer.oculus.com/documentation/publish/latest/concepts/publish-mobile-manifest/ but I can't get it to work.
After some troubleshooting I found that I can do all the changes described there, except for changing the activity name. As soon as I change the activity name the app no longer works. I get a message that the app has unexpectedly closed.
The activity name now is 'com.google.unity.GoogleUnityActivity', probably because in my project I use both Gear VR and Google Cardboard. With that activity name the app works fine. According to the documentation I should change it to 'YOUR ACTIVITY', but I can't find any information on how to find the activity in my Unity project. I tried a common option '<my_package_name>.MainActivity', but that didn't work.
So how can I find my activity? Or do I need to specifiy it somewhere (couldn't find it in the player settng either)?
Thanks.
After some troubleshooting I found that I can do all the changes described there, except for changing the activity name. As soon as I change the activity name the app no longer works. I get a message that the app has unexpectedly closed.
The activity name now is 'com.google.unity.GoogleUnityActivity', probably because in my project I use both Gear VR and Google Cardboard. With that activity name the app works fine. According to the documentation I should change it to 'YOUR ACTIVITY', but I can't find any information on how to find the activity in my Unity project. I tried a common option '<my_package_name>.MainActivity', but that didn't work.
So how can I find my activity? Or do I need to specifiy it somewhere (couldn't find it in the player settng either)?
Thanks.
9 Replies
Replies have been turned off for this discussion
- ProfessorTroyAdventurerI'm having a similar problem... if you find it please respond.
- ProfessorTroyAdventurerFound the issue:
Setting my "MainActivity" line to:
android:name="com.unity3d.player.UnityPlayerNativeActivity"
It now launches properly from the GearVR Home.
Cheers!! - jbossProtegeGreat! thanks!
(I feel a bit silly that you found it within 30 minutes :#) - ProfessorTroyAdventurerHa no. I spent ~2-3hrs looking around. Posted here as part of my search, and then continued to dig. I just got lucky that I figured it out 30 minutes later. This error is definitely unique to Unity. Most other development would have a clear "Main" entry point that you would have pointed that line at.
- bsawyerJRGHonored GuestOMG This just saved me! Using the documented AndroidManifest.xml changes (including setting the .INFO intent filter and vr_only metadata) my app was just crashing instantly when I tried to launch from Oculus Home.
Changing my activity's android:name attribute from "com.mycompany.myapp.UnityPlayerNativeActivity" to "com.unity3d.player.UnityPlayerNativeActivity" solved the crash issue and it now launches just fine from Oculus Home.
Can anybody say whether this is a Unity or Oculus bug? - ezoneProtegeWhere do dev apps show up in Oculus Home? (I can't see mine)
- spiraloidProtegeany updates on this? I'm hitting it too.
- vrdavebOculus StaffThis was fixed a few months ago. See the following from the developer guide:
To build an APK that includes a manifest with the values required by the Oculus Store, you must download the Oculus Utilities for Unity 5 package and import it into your project as described in Importing the Oculus Utilities Package.
Once you have a done so, in the Unity Editor, select Tools > Oculus > Create store-compatible AndroidManfiest.xml. Then build your project normally.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 3 years ago
- 9 months ago