Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
jboss's avatar
jboss
Protege
10 years ago

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.

9 Replies

Replies have been turned off for this discussion
  • Found the issue:

    Setting my "MainActivity" line to:

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

    It now launches properly from the GearVR Home.

    Cheers!!

  • Great! thanks!

    (I feel a bit silly that you found it within 30 minutes :#)
  • 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.
  • 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?
  • Where do dev apps show up in Oculus Home? (I can't see mine)
  • 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.
  • vrdaveb's avatar
    vrdaveb
    Oculus Staff
    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.