刚刚启动GearVR的虚幻开发,并在IDE设置和配置几天后在hello-world教程上遇到一个奇怪的错误。希望互联网的力量可以指导我。
完成本教程: https://docs.unrealengine.com/latest/INT/Platforms/GearVR/QuickStart/index.html
当我在Android ETC2上构建时,我得到一个相当长的构建错误列表,以无用的错误终止:
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: [buildconfig] Generating BuildConfig class.
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool:
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: -pre-compile:
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool:
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: -compile:
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: [javac] Compiling 78 source files to C:\Users\User\Documents\VR\GearVR_test\Intermediate\Android\APK\bin\classes
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: [javac] C:\Users\User\Documents\VR\GearVR_test\Intermediate\Android\APK\src\com\android\vending\licensing\APKExpansionPolicy.java:20: error: package org.apache.http does not exist
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: [javac] import org.apache.http.NameValuePair;
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: [javac] ^
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: [javac] C:\Users\User\Documents\VR\GearVR_test\Intermediate\Android\APK\src\com\android\vending\licensing\APKExpansionPolicy.java:21: error: package org.apache.http.client.utils does not exist
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: [javac] import org.apache.http.client.utils.URLEncodedUtils;
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: [javac] ^
...
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: BUILD FAILED
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: C:\Users\User\AppData\Local\Android\sdk\tools\ant\build.xml:716: The following error occurred while executing this line:
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: C:\Users\User\AppData\Local\Android\sdk\tools\ant\build.xml:730: Compile failed; see the compiler error output for details.
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool:
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: Total time: 29 seconds
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: UnrealBuildTool Exception: System.IO.FileNotFoundException: Could not find file 'C:\Users\User\Documents\VR\GearVR_test\Intermediate/Android/APK/bin/GearVR_test-debug.apk'.
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: File name: 'C:\Users\User\Documents\VR\GearVR_test\Intermediate/Android/APK/bin/GearVR_test-debug.apk'
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
UATHelper: Packaging (Android (ETC2)): 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 (ETC2)): UnrealBuildTool: at UnrealBuildTool.UEDeployAndroid.PrepTargetForDeployment(UEBuildTarget InTarget)
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool: at UnrealBuildTool.UnrealBuildTool.DoPostStartupStuffThatCanAccessConfigs(String[] Arguments)
UATHelper: Packaging (Android (ETC2)): CommandUtils.Run: Run: Took 112.6859102s to run UnrealBuildTool.exe, ExitCode=5
UATHelper: Packaging (Android (ETC2)): Program.Main: ERROR: AutomationTool terminated with exception: AutomationTool.CommandUtils+CommandFailedException: Command failed (Result:5): C:\Program Files (x86)\Epic Games\4.13\Engine\Binaries\DotNET\UnrealBuildTool.exe GearVR_test Android DebugGame -p
UATHelper: Packaging (Android (ETC2)): repfordeploy -project="C:\Users\User\Documents\VR\GearVR_test\GearVR_test.uproject" -NoHotReload -ignorejunk. See logfile for details: 'UnrealBuildTool-2016.09.04-17.16.25.txt'
UATHelper: Packaging (Android (ETC2)): at AutomationTool.CommandUtils.RunAndLog(String App, String CommandLine, String Logfile, Int32 MaxSuccessCode, String Input, ERunOptions Options, Dictionary`2 EnvVars, SpewFilterCallbackType SpewFilterCallback)
UATHelper: Packaging (Android (ETC2)): 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 (ETC2)): at AutomationTool.CommandUtils.RunUBT(CommandEnvironment Env, String UBTExecutable, String CommandLine, String LogName, Dictionary`2 EnvVars)
UATHelper: Packaging (Android (ETC2)): at AndroidPlatform.PostBuildTarget(UE4Build Build, FileReference UProjectPath, String TargetName, String Config)
UATHelper: Packaging (Android (ETC2)): 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 (ETC2)): 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, Dictiona
ry`2 InTargetToManifest)
UATHelper: Packaging (Android (ETC2)): at Project.Build(BuildCommand Command, ProjectParams Params, Int32 WorkingCL, ProjectBuildTargets TargetMask)
UATHelper: Packaging (Android (ETC2)): at BuildCookRun.DoBuildCookRun(ProjectParams Params)
UATHelper: Packaging (Android (ETC2)): at AutomationTool.BuildCommand.Execute()
UATHelper: Packaging (Android (ETC2)): at AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 Commands)
UATHelper: Packaging (Android (ETC2)): at AutomationTool.Automation.Process(String[] Arguments)
UATHelper: Packaging (Android (ETC2)): at AutomationTool.Program.MainProc(Object Param)
UATHelper: Packaging (Android (ETC2)): at AutomationTool.InternalUtils.RunSingleInstance(Func`2 Main, Object Param)
UATHelper: Packaging (Android (ETC2)): at AutomationTool.Program.Main()
UATHelper: Packaging (Android (ETC2)): Program.Main: AutomationTool exiting with ExitCode=5 (5)
UATHelper: Packaging (Android (ETC2)): BUILD FAILED
PackagingResults:Error: Error Unknown Error
我可以采取哪些措施来解决上述错误,以便制作一个APK,我该怎么做才能理解并更好地谷歌诊断这些错误?
针对此错误引用类似的Google搜索结果:
答案 0 :(得分:0)
我没有完整的解决方案,但我认为我对此问题有一个诊断(我也遇到过)。
出于某种原因,Codeworks Android SDK设置包含依赖于过时版本的org.apache.http的元素。如果您使用的是SDK 23或更高版本,则此依赖关系不再包含在构建设置中(旧版本存储在“可选”文件夹中),但虚幻构建/打包过程仍会尝试包含它。
我正在尝试找出针对虚幻版本的修复程序...到目前为止我发现的最好的是将所有构建和打包设置更改为目标Android SDK和NDK 21或更低版本(很多人推荐19,但21似乎对我有用。)
不幸的是,这意味着您无法利用最新Android SDK中包含的大量VR优化,因此我仍在寻找更好的解决方案。
以下是针对一般Android应用开发的此问题的深入讨论:
Android Gradle Apache HttpClient does not exist?
...但是由于使用Unreal很多Android构建过程被引擎模糊或自动处理,我还不知道是否有办法自定义app.gradle等文件来处理这个问题。
希望这有点帮助,无论如何。