[Gear VR] Distribution version of app crashes on Note 4 (Mobile VR Jam)

Hey All!

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/VrApi   (10626): ovr_OnLoad()

I/VrApi   (10626): Using caller's JNIEnv

E/JniUtils(10626): FindClass( com/oculusvr/vrlib/VrLib ) failed

F/libc    (10626): Fatal signal 6 (SIGABRT) at 0x00002982 (code=-6), thread 10626 (ech.Circumpaint)

D/CustomFrequencyManagerService(  933): releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT  frequency : 2649600  uid : 1000  pid : 933  tag : ROTATION_BOOSTER@35

I/DEBUG   ( 1838): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

I/DEBUG   ( 1838): Build fingerprint: 'samsung/trltexx/trlte:4.4.4/KTU84P/N910FXXU1ANK4:user/release-keys'

I/DEBUG   ( 1838): Revision: '12'

I/DEBUG   ( 1838): pid: 10626, tid: 10626, name: ech.Circumpaint  >>> com..Circumpaint <<<

I/DEBUG   ( 1838): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------

E/csd_client(  329): csd_service_init: Check modem power up with MDM reset !!!

I/DEBUG   ( 1838):     r0 00000000  r1 00002982  r2 00000006  r3 00000000

I/DEBUG   ( 1838):     r4 00000006  r5 0000000b  r6 00002982  r7 0000010c

I/DEBUG   ( 1838):     r8 00000000  r9 00000000  sl 417fa4d8  fp bee7d240

I/DEBUG   ( 1838):     ip 7b8857f8  sp bee7d100  lr 401101b5  pc 4011f15c  cpsr 000f0010

I/DEBUG   ( 1838):     d0  0000000000000000  d1  0000000000000000

I/DEBUG   ( 1838):     d2  0000000000000000  d3  0000000000000000

I/DEBUG   ( 1838):     d4  000000006f911ba4  d5  0000000000000000

I/DEBUG   ( 1838):     d6  0000000000000000  d7  3f4000003f4ccccd

I/DEBUG   ( 1838):     d8  0000000000000000  d9  0000000000000000

I/DEBUG   ( 1838):     d10 0000000000000000  d11 0000000000000000

I/DEBUG   ( 1838):     d12 0000000000000000  d13 0000000000000000

I/DEBUG   ( 1838):     d14 0000000000000000  d15 0000000000000000

I/DEBUG   ( 1838):     d16 6c75636f2f6d6f63  d17 6c72762f72767375

I/DEBUG   ( 1838):     d18 006e00650076002f  d19 002f0072006f0064

I/DEBUG   ( 1838):     d20 002c00620069006c  d21 00790073002f0020

I/DEBUG   ( 1838):     d22 006d006500740073  d23 00620069006c002f

I/DEBUG   ( 1838):     d24 0000000000000000  d25 0000000000000000

I/DEBUG   ( 1838):     d26 0000000000000000  d27 0000000000000000

I/DEBUG   ( 1838):     d28 0100010001000100  d29 0100010001000100

I/DEBUG   ( 1838):     d30 0000000000000000  d31 0000000000000000

I/DEBUG   ( 1838):     scr 80000010

I/DEBUG   ( 1838): 

I/DEBUG   ( 1838): backtrace:

I/DEBUG   ( 1838):     #00  pc 0002215c  /system/lib/libc.so (tgkill+12)

I/DEBUG   ( 1838):     #01  pc 000131b1  /system/lib/libc.so (pthread_kill+48)

I/DEBUG   ( 1838):     #02  pc 000133c5  /system/lib/libc.so (raise+10)

I/DEBUG   ( 1838):     #03  pc 000120fb  /system/lib/libc.so

I/DEBUG   ( 1838):     #04  pc 00021a10  /system/lib/libc.so (abort+4)

I/DEBUG   ( 1838):     #05  pc 0355c4c4  /data/app-lib/com..Circumpaint-1/libUE4.so (ovr_GetGlobalClassReference(_JNIEnv*, char const*)+112)

I/DEBUG   ( 1838):     #06  pc 03525c00  /data/app-lib/com..Circumpaint-1/libUE4.so (ovr_OnLoad+212)

I/DEBUG   ( 1838):     #07  pc 03258108  /data/app-lib/com..Circumpaint-1/libUE4.so (FGearVRPlugin::PreInit()+64)

I/DEBUG   ( 1838):     #08  pc 00fb5ae8  /data/app-lib/com..Circumpaint-1/libUE4.so (Java_com_epicgames_ue4_GameActivity_nativeInitHMDs+72)

I/DEBUG   ( 1838):     #09  pc 000210cc  /system/lib/libdvm.so (dvmPlatformInvoke+112)

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!

, can you get me copies of the distribution and non-distribution apks? PM me a google drive link or anything like that?

It sounds like the oculus Java lib is missing or somehow broken.

:confused:

Suspect I’m going to but up against this issue very soon.

Any tips or pointers on where to look for details on packaging up for distribution/delivery for final Jam deadline are most welcome.

Hey!

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.

Cheers!

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:

https://developer.oculus.com/signer/

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:

  1. 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

  1. 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 :frowning: 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.

Thanks!

I get the crash as well and I haven’t made 's changes.

@Gnoemtech: I the minsdk version setting is step #5 here: https://docs.unrealengine.com/latest/INT/Platforms/GearVR/QuickStart/2/index.html

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!

@JJ:

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.

Thanks!

Hi All,

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.

I hope this will do…

@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.

Hi ,

Ah…now the penny drops; I did not alter the xml file. It has been a while since I packaged for Android.
I will try again and see how this works out.

-Berrie

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.

Hey JJ:

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!

Hi and JJ,

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.

Kind regards,
Berrie

@NanoMind:
Sounds like you’ll want to make the first change that I made in this posting above: https://forums.unrealengine.com/showthread.php?69446-Gear-VR-Distribution-version-of-app-crashes-on-Note-4-(Mobile-VR-Jam)&p=288252&viewfull=1#post288252.

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!