Trouble packaging Google VR project for Android. For Distribution

Or a way to sign an already packaged apk?

A bit late, but yes there is. Or you can use jarsigner.exe if you prefer, but note that the order of the zipalign step differs in its case.

jarsigner.exe documentation:

Command line

-sigalg Signature Algorithms

-digestalg Message Digest Algorithms

The video is not that good, but I hope it will help. Unreal Engine 4 GoogleVR packaging for distribution - YouTube
Pls. support me by downloading my first app. The link is in the video description.

Same problem … api-21
I have build the project with disabling the GoogleVR plugin also and it does build.
Can we just type “-dontskipnonpubliclibraryclassmembers” somewhere? I tried to put it into ${sdk.dir}/tools/proguard/proguard-android.txt and proguard-project.txt
but it still says :

[proguard]          Alternatively, you may have to specify the option 
[proguard]          '-dontskipnonpubliclibraryclassmembers'.

Did you try to follow my video? It is very important to use SDK and NDK API android-24, then under android options set minimum API 21 and target 24. That is a solution for now. I am running my game on android 5.0 phone. Also use new engine version 4.14.

Unreal Engine 4 GoogleVR packaging for distribution - YouTube

Yes! Seems that it works for now. Thank you.
(Not with SDK and NDK API android-21)
And only if you download latest ProGuard. (Default one seems to have problems with Java 8)

I tested it only on Xaiomi redmi note 3. Try to turn off mobile HDR (in engine > rendering). Let me know if it works.

What version of android is running on each device you tested on?

Hi n3d057upn1. This build successfully only on api 24, but it crashes on my phone(s4 mini) and tested on other phone(s6 edge) and crashes as well, both using the marshmallow version. I have downloaded your game as well but it crash too. Have you tested your game on other devices like the samsung s6 maybe?

I have tested it on version 6.0.1 (samsung s6 edge) and on my s4 mini its also version 6.0.1, but I have rooted my phone and installed a CyanogenMod version. Does it work on your device ?

S7 edge 6.0.1 also crashes straight on startup :frowning:

Same with S3

Crashing on start up is another problem i guess) At least it packaged)

Are you also using Samsung? I can run game on my Xaiomi without any problem. I will install some emulator for Samsung and try something.

Have anyone solve the problem yet? I’ve been busy with other work, going to check if I can get something during the week.

Thanks a lot, @SlipStream7800 ! I managed to do it with apksigner.

Now, PlayStore complains that the apk is debuggable and it shouldn’t be. So it seems Unreal builds the apk as debuggable even though I set the Package mode to Shipping. So I have to turn on the For Distribution option in UE and we’re back to square 1. :frowning:

I tried finding if there’s a way to convert debuggable to release, but nothing turned out.

I’ve managed to do it!!

  • I’m using Unreal Engine 4.14
  • Following @n3d057upn1 [video][1], I replaced ProGuard with the [recent version][2].
  • A bit differently from the video, in the SDK Manager I installed only SDK Platform and Google APIs from the APIs 22 to 24.

  • In Project Settings > Platforms > Android > APKPackaging I set Minimum SDK Version = 21 and Target SDK Version = 24

  • On the same page, at the Advanced APKPackaging section I set Configure GoogleVR Deployment Mode = Cardboard

  • At the Distribution Signing section I setup my keystore
  • In Project Settings > Platforms > Android SDK I set SDK API Level = android-24, as in the video, BUT I set NDK API Level = android-19.

I read elsewhere here on Answers that it doesn’t matter if the NDK Level is less than the SDK one. And, as it is the C++ part, I thought it was causing the crash on startup (I had that) because of incompatibilities with UE4’s C++ code. Setting it back to the old and known android-19 worked. Packaged and Launched successfully!

You and n3d057upn1 are my heroes! This works!

But, what is the real diffrence from the video? It was crashing on startup on some devices (not mine) ( only android 6.0 devices? ). And if we set NDK Level to api-19 from api-24 it will stop crashing?
P.S. I would really love target SDK=21 (22?) solution. cause target SDK>21 (22?) causes known issue with OBB on Android 6.0. Google Issue Tracker

@MrKewer, glad it helped! , The only differences from the video are:

  • I downloaded less content in the SDK manager
  • NDK API set to android-19. Changing only that stopped the crashing on launch. As I said, probably because with >19 there are incompatibilities between UE’s and NDK’s native codes.

About the issue, maybe it was corrected with target SDK 24, because I didn’t have any trouble.

, You were right. I didn’t have any trouble on my Nexus 5, even installing from Google Play, but on Samsung phones I always get the XAPK Validation Failed error.

@tim_hobson, is there a fix for it? I heard there was a modified OBB downloader in 4.14 that fixes this issue with API 23/24. How do we use it?