Skip to main content
Inspiring
July 13, 2016

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.
    This topic has been closed for replies.

    9 replies

    Inspiring
    July 13, 2016
    I'm having a similar problem... if you find it please respond.
    Inspiring
    July 13, 2016
    Found the issue:

    Setting my "MainActivity" line to:

    android:name="com.unity3d.player.UnityPlayerNativeActivity"

    It now launches properly from the GearVR Home.

    Cheers!!

    jbossAuthor
    Inspiring
    July 14, 2016
    Great! thanks!

    (I feel a bit silly that you found it within 30 minutes :#)
    Inspiring
    July 14, 2016
    Ha 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.
    New Participant
    July 28, 2016
    OMG 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?
    ezone
    Up and Coming
    July 31, 2016
    Where do dev apps show up in Oculus Home? (I can't see mine)
    Simon Edis - Ezone.com
    Inspiring
    August 1, 2016
    This is a known (major) bug in the Oculus Unity integration.We are working to fix it ASAP. In the meantime, you can follow the steps here to unpack, edit, and re-pack your APK before submission.
    Participant
    May 18, 2017
    any updates on this?  I'm hitting it too.  
    Inspiring
    May 18, 2017
    This 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.