x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Fails to package GoogleVR for Android 4.x

I've tried to package a CardBoard project that will run on Android 4 or 4.4 and onwards. Project settings-APK packaging- Minimum SDK v and Target SDK both at 9, Android-SDK SDK API Level and NDK APi Level both android-19. It packages fine, but once I activate the Google VR plugin it fails unless SDK API and NDK API are android-21. The finished apk then won't install on my 4.4 phone. Is it possible to package a Google cardboard project to android 4.x?

Product Version: UE 4.13
Tags:
more ▼

asked Nov 05 '16 at 10:01 AM in Packaging & Deployment

avatar image

Magnvs
11 1 2 6

avatar image Samantha Sutton ♦♦ STAFF Nov 10 '16 at 07:03 PM

Hey Magnvs,

Kitkat should work for Google Cardboard on Android 19 or 21. The documentation says to use Android-21 though, but I have deployed VR projects using Android-19 recently.

Please upload your error output logs as a .txt file, thanks!

Google VR Quick Start

avatar image Magnvs Nov 11 '16 at 08:21 AM

Hi, Thanks for your response.

I asked the same question on the forums and someone said Cardboard was only supported by API-21. Mine fails immediately with 19 rather than 21. What engine version did you package with? I will upload output logs once I get home.

-M

avatar image Magnvs Nov 11 '16 at 12:24 PM

Hi, I'm uploading my log from my attempt just now.link text And also my codeworks install. This is a Win 10 64bit comp (somehow UE4 installed itself as 32 bit though), using 64 bit codeworks. 6700k i7 cpu, nvidia 1080 vid, 32gb ram. UE running from ssd.

alt text

codeworks2.jpg (220.5 kB)
output.txt (1.1 MB)
avatar image Samantha Sutton ♦♦ STAFF Nov 15 '16 at 09:08 PM

Magnvs,

If you're using GoogleVR, you could mean Daydream or Cardboard. Please make sure you specify which you're using.

Android 23 and 24 should be working fine in 4.14.0 which just released today. Try updating to 4.14.0. Keep in mind that 1R5 Codeworks isn't installing Android 23 or 24 by default.

Thanks!

avatar image Magnvs Nov 16 '16 at 01:00 AM

Advanced APKPackaging is set to Cardboard deployment mode. I followed the guide on https://docs.unrealengine.com/latest/INT/Platforms/GoogleVR/QuickStart/index.html but it appears to be a little dated and I'm not sure whether it focuses on Cardboard or Daydream..

I packaged with the 4.14 preview earlier, but it wouldn't complete Android 19.

avatar image Samantha Sutton ♦♦ STAFF Nov 17 '16 at 04:49 PM

Which version of Codeworks are you using? Is it 1R5? 1R4u2?

Have you tried upgrading to Android-21, or using Android-23 or 24 in the release of 4.14.0 as stated above?

For updated information and community guides, I'd suggest the forums if you've not looked there either.

avatar image Magnvs Nov 18 '16 at 12:30 AM

I installed 1R5 yesterday and made a new test project on UE 4.14, same as before; It packages in 21 but not 19, I'm not sure about 23 or 24 because the config screen clearly says 21 and later won't install on Android 4.4 so it's of no use to me. Packaged 21 will not install on my 4.4 test devices.

avatar image Samantha Sutton ♦♦ STAFF Nov 21 '16 at 07:25 PM

Can you please verify that you've installed everything under Android 4.4.2 (API 19) from CodeWorks?

AndroidWorks

avatar image Magnvs Nov 24 '16 at 01:49 AM

I will try to install Intel x96 Atom system image and ARM EABI v7 tonight, currently it seems only the SDK Platform was installed by default.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

GoogleVR will need the Android SDK set to 21, Daydream is at 24. 19 is for GearVR. Sorry for any confusion. Please adjust your settings in your project settings so that it'll package correctly.

Thanks!

more ▼

answered Dec 06 '16 at 10:37 PM

avatar image Magnvs Dec 08 '16 at 12:40 AM

By GoogleVR you mean Cardboard?

avatar image Samantha Sutton ♦♦ STAFF Dec 08 '16 at 06:46 PM

Yes, that is correct. Sorry for the confusing wording. :)

avatar image Magnvs Dec 09 '16 at 02:11 AM

So Cardboard won't package for KitKat? :|

avatar image Samantha Sutton ♦♦ STAFF Dec 13 '16 at 11:12 PM

Google's requirements for Cardboard on an Android device is version 4.1 or higher, so KitKat would be included. However, based on the information I've verified with our Android team, Google VR is for Android 21 and Daydream is for 24.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hi, I'm in the same boat as you are (i.e. trying to get a Google VR test app to build against KitKat / API level 19), but after reviewing the build log and a bit of grepping around the files, I've found a way to get the project to work on KitKat devices (and yes, the resulting app is indeed functional as intended on my test device).


The symptom:

 UATHelper: Packaging (Android (ATC)): UnrealBuildTool:      [aapt] X:\ue4projects\PROJECTNAME\Intermediate\Android\APK\JavaLibs\common_library\res\values-v21\values.xml:5: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Material.Light.Dialog'.
 .
 .
 .
 UATHelper: Packaging (Android (ATC)): BUILD FAILED
 PackagingResults:Error: Error Unknown Error

(Here's some log context to assist in identification for anyone stumped by the same issue)

 UATHelper: Packaging (Android (ATC)): UnrealBuildTool: -code-gen:
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool: [mergemanifest] Found Deleted Target File
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool: [mergemanifest] Merging AndroidManifest files into one.
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool: [mergemanifest] Manifest merger disabled. Using project manifest only.
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool:      [echo] Handling aidl files...
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool:      [aidl] No AIDL files to compile.
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool:      [echo] ----------
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool:      [echo] Handling RenderScript files...
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool:      [echo] ----------
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool:      [echo] Handling Resources...
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool:      [aapt] Generating resource IDs...
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool:      [aapt] X:\ue4projects\PROJECTNAME\Intermediate\Android\APK\JavaLibs\common_library\res\values-v21\values.xml:5: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Material.Light.Dialog'.
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool:      [aapt] 
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool: 
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool: BUILD FAILED
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool: X:\NVPACK\android-sdk-windows\tools\ant\build.xml:597: The following error occurred while executing this line:
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool: X:\NVPACK\android-sdk-windows\tools\ant\build.xml:649: The following error occurred while executing this line:
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool: X:\NVPACK\android-sdk-windows\tools\ant\build.xml:694: null returned: 1
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool: 
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool: Total time: 28 seconds
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool: UnrealBuildTool Exception: System.IO.FileNotFoundException: Could not find file 'X:\ue4projects\PROJECTNAME\Intermediate/Android/APK/bin/PROJECTNAME-debug.apk'.
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool: File name: 'X:\ue4projects\PROJECTNAME\Intermediate/Android/APK/bin/PROJECTNAME-debug.apk'
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool:    at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool:    at UnrealBuildTool.UEDeployAndroid.MakeApk(AndroidToolChain ToolChain, String ProjectName, String ProjectDirectory, String OutputPath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bMakeSeparateApks, Boolean bIncrementalPackage, Boolean bDisallowPackagingDataInApk)
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool:    at UnrealBuildTool.UEDeployAndroid.PrepTargetForDeployment(UEBuildTarget InTarget)
 UATHelper: Packaging (Android (ATC)): UnrealBuildTool:    at UnrealBuildTool.UnrealBuildTool.DoPostStartupStuffThatCanAccessConfigs(String[] Arguments)
 UATHelper: Packaging (Android (ATC)): CommandUtils.Run: Run: Took 134.4116879s to run UnrealBuildTool.exe, ExitCode=5
 UATHelper: Packaging (Android (ATC)): Program.Main: ERROR: AutomationTool terminated with exception: AutomationTool.CommandUtils+CommandFailedException: Command failed (Result:5): X:\Epic Games\4.14\Engine\Binaries\DotNET\UnrealBuildTool.exe PROJECTNAME Android Development -Project=X:\ue4projects\PROJECTNAME\PROJECTNAME.uproject  X:\ue4projects\PROJECTNAME\PROJECTNAME.uproject  -remoteini="X:\ue4projects\PROJECTNAME" -noxge -NoHotReload -ignorejunk. See logfile for details: 'UnrealBuildTool-2016.11.23-04.53.20.txt' 
 UATHelper: Packaging (Android (ATC)):    at AutomationTool.CommandUtils.RunAndLog(String App, String CommandLine, String Logfile, Int32 MaxSuccessCode, String Input, ERunOptions Options, Dictionary`2 EnvVars, SpewFilterCallbackType SpewFilterCallback)
 UATHelper: Packaging (Android (ATC)):    at AutomationTool.CommandUtils.RunAndLog(CommandEnvironment Env, String App, String CommandLine, String LogName, Int32 MaxSuccessCode, String Input, ERunOptions Options, Dictionary`2 EnvVars, SpewFilterCallbackType SpewFilterCallback)
 UATHelper: Packaging (Android (ATC)):    at AutomationTool.CommandUtils.RunUBT(CommandEnvironment Env, String UBTExecutable, String CommandLine, String LogName, Dictionary`2 EnvVars)
 UATHelper: Packaging (Android (ATC)):    at AutomationTool.CommandUtils.RunUBT(CommandEnvironment Env, String UBTExecutable, FileReference Project, String Target, String Platform, String Config, String AdditionalArgs, String LogName, Dictionary`2 EnvVars)
 UATHelper: Packaging (Android (ATC)):    at AutomationTool.UE4Build.BuildWithUBT(String TargetName, UnrealTargetPlatform TargetPlatform, String Config, FileReference UprojectPath, Boolean ForceMonolithic, Boolean ForceNonUnity, Boolean ForceDebugInfo, Boolean ForceFlushMac, Boolean DisableXGE, String InAddArgs, Boolean ForceUnity, Dictionary`2 EnvVars)
 UATHelper: Packaging (Android (ATC)):    at AutomationTool.UE4Build.Build(BuildAgenda Agenda, Nullable`1 InDeleteBuildProducts, Boolean InUpdateVersionFiles, Boolean InForceNoXGE, Boolean InUseParallelExecutor, Boolean InForceNonUnity, Boolean InForceUnity, Boolean InShowProgress, Dictionary`2 PlatformEnvVars, Nullable`1 InChangelistNumberOverride, Dictionary`2 InTargetToManifest)
 UATHelper: Packaging (Android (ATC)):    at Project.Build(BuildCommand Command, ProjectParams Params, Int32 WorkingCL, ProjectBuildTargets TargetMask)
 UATHelper: Packaging (Android (ATC)):    at BuildCookRun.DoBuildCookRun(ProjectParams Params)
 UATHelper: Packaging (Android (ATC)):    at AutomationTool.BuildCommand.Execute()
 UATHelper: Packaging (Android (ATC)):    at AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 Commands)
 UATHelper: Packaging (Android (ATC)):    at AutomationTool.Automation.Process(String[] Arguments)
 UATHelper: Packaging (Android (ATC)):    at AutomationTool.Program.MainProc(Object Param)
 UATHelper: Packaging (Android (ATC)):    at AutomationTool.InternalUtils.RunSingleInstance(Func`2 Main, Object Param)
 UATHelper: Packaging (Android (ATC)):    at AutomationTool.Program.Main()
 UATHelper: Packaging (Android (ATC)): Program.Main: AutomationTool exiting with ExitCode=5 (5)
 UATHelper: Packaging (Android (ATC)): BUILD FAILED
 PackagingResults:Error: Error Unknown Error


It's easy to miss it at first glance, but the root cause of the issue is that KitKat doesn't provide the Material Design theme on its own (since that debuted later with Lollipop) so @android:style/Theme.Material.Light.Dialog cannot be resolved.

This can be worked around by replacing it with a theme that exists in KitKat, but not within the file mentioned in the error message - that's merely a copy of another file that resides within the engine's Source folder (and will therefore be clobbered the next time you try to package the app).

The actual file to modify is at X:\Path_To_Engine_Hierarchy\4.14\Engine\Source\ThirdParty\GoogleVR\lib\common_library\res\values-v21\values.xml, all you need to do is remove its read-only attribute (the usual right-click -> Properties stuff) and edit it with a text editor, changing:

 <style name="CardboardDialogTheme" parent="@android:style/Theme.Material.Light.Dialog"/>

To:

 <style name="CardboardDialogTheme" parent="@android:style/Theme.Holo.Light.Dialog"/>

(and don't forget to save the file ;) )

With that change, subsequent package attempts should then succeed.

Bear in mind that this is merely a workaround and is not a proper solution. Caveat emptor.


For reference, I also made changes to the following project settings:

Platform - Android

Minimum SDK Version: 19

Target SDK Version: 21

(Configure GoogleVR Deployment Mode remained set at Daydream & Cardboard)

Platform - Android SDK

SDK API Level: android-21*

NDK API Level: android-21*

* As mentioned in Samantha Sutton's comment below, if Target SDK Version is set to 21 then SDK API Level and NDK API Level should use android-21 and not android-19


Hope this helps, good luck.


It took me no less than 5 edit attempts to actually get the entire answer to show up, ergh. Please properly escape the greater/less than characters so messages don't get truncated, site admins. Thanks.

more ▼

answered Nov 22 '16 at 10:13 PM

avatar image

SlipStream7800
11 1 1

avatar image Magnvs Nov 24 '16 at 01:55 AM

Thanks, but if I set SDK and NDK to 21 it will always compile successfully, however it will not install on a 4.4 device. Does the workaround you describe allow Level 21 packages to install on Kitkat devices?

avatar image SlipStream7800 Nov 24 '16 at 09:40 PM

Hmm, I'm getting the same issue as you are when I set SDK and NDK to 21 (the installer batch script reports Failure [INSTALL_FAILED_OLDER_SDK] on my KitKat device).

I went ahead and decompiled both the older (i.e. 19/21/19/19 MinSDK/TargetSDK/SDKAPI/NDKAPI) and newer (i.e. 19/21/21/21 MinSDK/TargetSDK/SDKAPI/NDKAPI) APKs to compare their AndroidManifest.xml and apktool.yml files. Here's the relevant differences that I found:


Older APK:

apktool.yml

 sdkInfo:
   minSdkVersion: '19'
   targetSdkVersion: '21'

AndroidManifest.xml

 <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.YourCompany.PROJECTNAME" platformBuildVersionCode="19" platformBuildVersionName="4.4.2-1456859">

I'm not really familiar with the Android build process, but I'm guessing it's targeting 19 due to me specifying android-19 for the SDK and NDK API levels.


Newer APK:

apktool.yml

 sdkInfo:
   minSdkVersion: '21'
   targetSdkVersion: '21'

minSdkVersion: '21' despite being explicitly set to 19 in project settings? What's going on here? :S

AndroidManifest.xml

 <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.YourCompany.PROJECTNAME" platformBuildVersionCode="21" platformBuildVersionName="5.0.1-1624448">

Probably targeting 21 due to me specifying android-21 for the SDK and NDK API levels.


Digging around the files in the PROJECTNAME\Intermediate\Android folder, I found -armv7_-es2_AndroidManifest.xml, which contains:

 <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="21" />

What, 21 for minSdkVersion? But that makes no sense - I explicitly set that to 19 (and I even double-checked my project settings again)?


TL;DR

So I guess it seems like it's being forced to API level 21 either by the Android build tools, or by UE4, but I have no idea which component is responsible for this. :/

avatar image Samantha Sutton ♦♦ STAFF Nov 30 '16 at 09:09 PM

So when you're on kitkat, you need to use Android-19. Android-21 is going to cause trouble even if you lower the minimum to Android-19 and the Maximum to Android-21. It'll still throw out a failure because kitkat doesn't support Android-21 as it's for lollipop. If you use Android-19 though, it'll work for kitkat.

avatar image Magnvs Dec 01 '16 at 12:34 AM

Right, but Android 19 will not package unless the Google VR is disabled, that's what the question is about.

avatar image SlipStream7800 Dec 01 '16 at 03:37 PM

Yes, that is indeed the issue. Something seems to be implicitly forcing minSdkVersion from 19 back to 21 again, though I don't know what.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

SlipStream7800,

You should not use Android-19 as your SDK and NDK API Levels if your target SDK is 21. Please adjust it to Android-21.

Thank you!

more ▼

answered Nov 23 '16 at 03:54 PM

avatar image SlipStream7800 Nov 23 '16 at 07:32 PM

Ah, I was not aware of that restriction (not familiar with Android development), many thanks for correcting me. :)

I'll edit my answer to reflect it as well.

avatar image Samantha Sutton ♦♦ STAFF Nov 23 '16 at 10:03 PM

You're welcome. Let me know if you are still running into issues. :D

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question