We’re now down to the wire for the Mobile VR Jam and I’ve been trying to get a release/distribution build of my app working on the Note 4. If I package with the “For Distribution” flag set then my GearVR app crashes upon load. If I set the packaging “For Distribution” flag to false then my app will load on the Note 4, but this is considered a debug build and won’t be accepted for the VR Jam. Using logcat here is the information from the crash:
I’ve cut the dump off once it went past the relevant function calls. From this crash dump you can see that within ovr_OnLoad() that it is attempting to get the “com/oculusvr/vrlib/VrLib” class and it fails. This is within ovr_GetGlobalClassReference(). All stuff that is part of the Mobile SDK 0.5.
Has anyone else been able to get a distribution/release package to run? This is with “For Distribution” set and the Oculus check_submission.exe confirming this isn’t a debug build. If so, anything special you had to do?
I’m concerned that I won’t get this resolved in time for the end of the Jam, and if confirmed, it would mean that all UE4 entries are also in jeopardy.
Thanks for spotting this issue . I’m also participating in the VRJam, and I’ll be packaging my project soon.
Any insights on overcoming this potential problem are very welcome.
Are you guys sure we even need to do a ‘for distribution’ export? As per my understanding once we submit the apk to oculus their tool signs it with their own keystore so the community can install and use it:
So in theory this overwrites whatever we sign the apk with? In which case we could just do a shipping export that signs with the debug key and then their tool signs it for the jam
@JJ:
Thanks very much for offering to help. I’ll package up an empty game just to rule out my own code. Distribution and non-distribution, and both signed with the Jam’s global signer so you should be able to run them. Unfortunately, this will take some time.
@aussieburger:
I believe that the Jam’s global signer just takes the place of including your own “oculussig” file, and doesn’t perform the Android key signing. From the Reddit Jam Q&A on Thursday there were these two questions: Debug cert Exclude from Recents
Both of these conditions will occur if you don’t set “For Distribution” when packaging.
Note that I did have to modify two parts of UEDeployAndroid.cs to make sure I had the package set up correctly:
Force to be in LAUNCHER mode rather than INFO mode even when set as distribution. Oculus mentioned having the manifest setup like this as it makes it easier for the judges to launch (I’ll have to track down the link). Around line 685 I did this:
// DAW START Change this to always be Launcher for the Mobile VR Jam
//Text.AppendLine(string.Format(" <category android:name=\"android.intent.category.{0}\" />", (bPackageForGearVR && bIsForDistribution) ? "INFO" : "LAUNCHER"));
Text.AppendLine(string.Format(" <category android:name=\"android.intent.category.{0}\" />", (bPackageForGearVR && bIsForDistribution) ? "LAUNCHER" : "LAUNCHER"));
// DAW END
Make sure to include “android:targetSdkVersion” to get rid of an error shown when checking with Oculus’ validation tool. Around line 729:
Text.AppendLine(" <!-- Requirements -->");
// need just the number part of the sdk
// DAW START Added this check for GearVR to make changes for Oculus store
if (!bPackageForGearVR)
{
// DAW: This was the original, single line that was here
Text.AppendLine(string.Format(" <uses-sdk android:minSdkVersion=\"{0}\"/>", MinSDKVersion));
}
else
{
// GearVR: Required to pass Oculus' submission checker
Text.AppendLine(string.Format(" <uses-sdk android:minSdkVersion=\"{0}\" android:targetSdkVersion=\"{1}\"/>", MinSDKVersion, MinSDKVersion));
}
// DAW END
Text.AppendLine(" <uses-feature android:glEsVersion=\"0x00020000\" android:required=\"true\" />");
Many thanks for this info! Was not aware of that - unfortunately I have a similar problem when trying to export with ‘For Distribution’ ticked last time I checked Will test again shortly but takes so long to export when changing that checkbox …
For point number 2 setting the targetsdkversion in the editors packaging settings is not enough?
I’m putting together some examples now. It just takes forever to compile, package, and put through the global signer…
@aussieburger:
Oh, can we just put *targetSdkVersion *somewhere in the package settings? I’m new to Android and wasn’t sure how to exactly set that up, and found it quickest to just modify the build code. If you could share your own package settings I’m sure that will help everyone out.
While it is unfortunate that we’re all getting this crash, I’m glad it isn’t just me. I spent 4 hours last night (until 4am) trying to work out the correct steps to meet Oculus’ requirements and try to determine why my app was crashing. There’s still so much to do before my entry is ready…
@aussieburger:
I had made those changes and it does set the minSdkVersion, however it wasn’t setting targetSdkVersion in the manifest so that’s why I changed the build code. Without that addition check_submission.exe had the following error:
--> Target SDK version is , not 19 (targetSdkVersion)
@JJ:
Just sent you a PM with a link to the crashing version of Circumpaint. I had built it early this morning and sent it through the Oculus global signer. I just checked it now and it crashes with the error log I posted about.
I’m building a non-Distribution version of Circumpaint for you to compare with, and will send that along. Thanks!
I’ve just sent you a PM with a link to the non-crashing version of Circumpaint. I just built this one, and the only difference between this and the crashing version is that the “For Distribution” flag is not set. In both cases these are Shipping builds, and signed with Oculus’ global signer.
Not sure if it is of use for you all; but this is where I am at the moment:
I use the 4.7.6 Launcher version : Note 4; snapdragon 5.0.1
When I publish for shipping; I have a black-screen in the Gear; however I do see the touch-rings (we still didn’t take this out) from the Mobile-template.
Then I published for Development and took my Oculus-sig file out of the assets folder.
Send this APK to the global sig-site. Dowloaded it and it worked fine on my Gear
So apart from AA it is working for me.
@NanoMind:
When you build for shipping do you have the “For Distribution” flag set? It is with that flag that is causing the crash. Without it the package is being produced with a debug key, even if you have Shipping set. And so far, using a debug key is not allowed for the Jam.
Ok, we strongly suspect that this is proguard stripping symbols in release. Non-distribution builds don’t strip.
I’m not at my desk until later today, but there should be a proguard file in the 0.5 mobile SDK. Merge that with ours and hopefully things work better. If this is the issue, I’ll fix it for 4.8.
Looking in Engine\Source\ThirdParty\Oculus\LibOVRMobile\LibOVRMobile_050 that was part of the Pull Request you submitted, I can’t find a proguard file. I’ve also just finished downloading the full Mobile SDK v0.5.0 and did a file search there. I couldn’t find a proguard file there either. Is there another name it could go under? Anyone else have any ideas?
We probably will just have to wait until you get into the office. Thanks for helping us out on a Saturday!
Got a keystore; Build with flag for shipping.
Game will install;but does not show up with all the other files in the menu. I can only launch once directly after install. But is not working for me either.
The Gear store starts also; but my app keeps running in the background. Force stop it in the Application menu.
By default, a distribution build will not show up in the normal app area, but instead only shows in the GearVR application. This would be fine if you were submitting your app to GearVR store. However, for the Jam we need to be able to launch just like any other app. Changing the “INFO” to “LAUNCHER” in my posting above does this.
Once we get all of this sorted out, I don’t mind checking in my changes again to my Jam GitHub branch so others can use it.
It is interesting that you’re not getting a crash though. You are building with “Shipping” and “For Distribution”? Perhaps those combined with the LAUNCHER are causing the issue. Or your app is just not getting far enough along in the startup process because it isn’t opening its screen. For now I’m on hold with testing this until we hear back from JJ. I have a lot of other things to do on my app before the Jam is up!