Trouble packaging Google VR project for Android. For Distribution

I have successfully launch my project on my android device and package my project when I set my Build Configuration to development. When I set my project for Distribution the packaging fails. Please help.

I have also created a new project and still the same error.

[my log file for API version 21][1]

[my log file for API version 23][2]

===PERFORMING FINAL APK PACKAGE OPERATION================================================

UATHelper: Packaging (Android (ATC)): UEDeployAndroid.RunCommandLineProgramAndReturnResult: Making .apk with Ant... (note: it's safe to ignore javac obsolete warnings)

UATHelper: Packaging (Android (ATC)): Duplicated project name in import. Project custom_rules defined first in Z:\custom_rules.xml and again in Z:\JavaLibs\common_library\custom_rules.xml

UATHelper: Packaging (Android (ATC)):     [javac] Note: Some input files use or override a deprecated API.

UATHelper: Packaging (Android (ATC)):     [javac] Note: Recompile with -Xlint:deprecation for details.

UATHelper: Packaging (Android (ATC)):  [proguard] Warning: com.google.vr.cardboard.AndroidNCompat: can't find referenced method 'void setVrModeEnabled(boolean,android.content.ComponentName)' in class android.app.Activity

UATHelper: Packaging (Android (ATC)):  [proguard] Warning: com.google.vr.cardboard.AndroidNCompat: can't find referenced method 'boolean isSustainedPerformanceModeSupported()' in class android.os.PowerManager

UATHelper: Packaging (Android (ATC)):  [proguard] Warning: com.google.vr.cardboard.AndroidNCompat: can't find referenced method 'void setSustainedPerformanceMode(boolean)' in class android.view.Window

UATHelper: Packaging (Android (ATC)):  [proguard] Warning: com.google.vr.cardboard.StoragePermissionUtils: can't find referenced method 'void requestPermissions(java.lang.String[],int)' in class android.app.Activity

UATHelper: Packaging (Android (ATC)):  [proguard] Warning: com.google.vr.cardboard.StoragePermissionUtils: can't find referenced method 'int checkSelfPermission(java.lang.String)' in class android.content.Context

UATHelper: Packaging (Android (ATC)):  [proguard]       You should check if you need to specify additional program jars.

UATHelper: Packaging (Android (ATC)):  [proguard] Warning: there were 5 unresolved references to program class members.

UATHelper: Packaging (Android (ATC)):  [proguard]          Your input classes appear to be inconsistent.

UATHelper: Packaging (Android (ATC)):  [proguard]          You may need to recompile them and try again.

UATHelper: Packaging (Android (ATC)):  [proguard]          Alternatively, you may have to specify the option 

UATHelper: Packaging (Android (ATC)):  [proguard]          '-dontskipnonpubliclibraryclassmembers'.

UATHelper: Packaging (Android (ATC)): BUILD FAILED

UATHelper: Packaging (Android (ATC)): C:\NVPACK\android-sdk-windows\tools\ant\build.xml:871: Please correct the above warnings first.

[1]:112314- [2]:112312-

Hi Mrkewer,

Can you provide the full project log from the build that you tried? Also, does this same project package if you disable GoogleVR? If it’s still failing have you set up your Manifest file and distribution for the key store? Without this packaging with distribution will have issues. If you’ve not set this up try following the documentation here: Signing Android Projects for Release on the Google Play Store with Unreal Engine | Unreal Engine 5.1 Documentation

Thanks!

Hi ,

Thanks for helping me. I have build the project with disabling the GoogleVR plugin and it does build. I have created a few new projects to try it out but no luck. (so the log files differ a bit from the top post ).

I have upgraded my CodeWorks for Android to version 1R4u2 and I still cant seem to package it. I have notice that one of the errors I’ve getting setSustainedPerformanceMode is added in API level 24: Window  |  Android Developers

and I think this one as well setVrModeEnabled:

Then I upgraded my CodeWorks to 1R5 because my jdk version has given errors for building API level 24. But now if I try to package my game for API level 24 I get the error of package org.apache.http.client.utils does not exist.
And still getting the same error as before if I try API level 21 with CodeWorks 1R5.

Have you maybe tried to package it before? Which version of CodeWorks do you use and which API level?

Log for API 21

Log for API 23-24

Currently we do not support any API higher than android-22. This is being added to 4.14 and will require 1R5 and the extra step of using the SDK manager to install the platform. Currently we only install 19 and 21 by default.

If you resolve these on your end, I think that should clear up some of the issues you’re seeing and the differences. I only ever package for android-19 or 21 since these are the common ones being used for GearVR and GoogleVR that I’ve had experience with.

I’m also unable to build for android-24 with 4.14P2 and the latest included 1R5 codeworks.

See this thread for my build error: Which UE4 build is best for Google VR? & googlevr branch build error - XR Development - Unreal Engine Forums

For daydream support we should be able to build for android-24 as per the documentation here: https://developers.google.com/vr/unreal/daydream-in-unreal#additional_project_settings
or am I missing something?

Thanks for your reply. This will narrow my problem a bit down. I did try packaging my game for shipping without enabling “For Distribution” and it build with no error, but if I enable it, it does not package ( just some extra info). I was trying to package my game in Windows 8.1 and I am currently re-installing Unreal Engine on a different computer which has Windows 7 on it. I will then try to package it on that computer and will let you know what happens.

strange my build fails with android-24 without distribution ticked with 4.14P2, the latest codeworks in that UE4 version and windows 10.
You also following the settings here: https://developers.google.com/vr/unreal/daydream-in-unreal#additional_project_settings ?

Hi , I’m just trying to package my game for GoogleVR for distribution for any API not for Daydream, sorry. I haven’t used UE 4.14 but I have read on forms about previous versions that if Unreal Engine is at Preview stage its not meant to Package games or ship them because its still busy with fixing bugs etc.

But I see you want to build for development.
Have you tried maybe disable all other plugins you don’t use and run engine in admin mode. Or try to set the deployment mode to Daydream & Cardboard.

I see on your form you said something of a game you already created for GoogleVR did you uploaded it on the Play Store?

Hey sorry I misunderstood and thought you were also building for daydream :slight_smile:

I can confirm building for cardboard only with android-21 and For Distribution also fails for me in 4.14P2 (works without For Distribution).

We not released anything for cardboard yet - only GearVR (and hopefully Daydream next).

Hi . I have package an test project in Daydream I used the setting for the GoogleVR in the documentations and set the deployment mode to Daydream and I got it to build for development but not for Distribution tho. I’m using UE 13.2 and set my API level to 21 and use Android CodeWorks 1R5. I do not have an Daydream capable device to test it on so dont know if it does work or not. But it does package with these settings.

Hi . I have installed Unreal Engine on my windows 7 computer and tried to package a new project For Distribution and still no luck. I can package it for development and for shipping and if I disable the plugin for GoogleVR I can package my project For Distribution.

Can you please try to package a project for GoogleVR For Distribution and see if yours can package it. It would help me a lot if someone can confirm that it does package then I know there is something wrong I’m doing

I’ve got the same exact problem and was introduced after 4.13.1, and it still on 4.13.2…

I’ve reported it on the Unreal forum:

Same error, attached my log.

Also, fresh installation of 4.13.2, fresh installation of AndroidWorks, and compiling one of the included demos, with Google VR plugin, in shipping + distribution, generated a build failed.

link text

Thanks for also posting on the forms hope we can get an answer soon. I don’t know what else to try anymore. I can even build for distribution for Gear VR but not for Google VR.

We’re in 4.13.2 and have also encountered being unable to package builds for distribution (API version 21).

Logging isn’t the same, but it is similar. I’d attach the file, but Answerhub seems to be having some sort of issues right now.

UE 4.13.2

Same problem as you guys. Just unticking “For distribution” solved it for compiling in Shipping config. And I know the problem wasn’t my keystore because I used the same settings and keystore from another project (that hasn’t GoogleVR) that compiles just fine.

Now, is there a workaround to be able to publish to the playstore without signing the apk? Or a way to sign an already packaged apk?

I have downloaded UE 4.14 today and tried packaging a new project, but same problem.

I successfully package my Google VR game for distribution, with 4.14 engine version. I will make some tutorial soon, after few more testing.

That would be really handy - I appreciate you taking the time to do a write up!

Thank you! n3d057upn1. Cant wait to see the tutorial. Appreciate it a lot.