I got the below error while building the UE4 movement sample app for quest pro, following a well-explained video [Link].
UATHelper: Packaging (Android (ASTC)): ERROR: Failed to build "C:/Github/UnrealOculus/Engine/Programs/AutomationTool/Saved\UATTempProj.proj":
UATHelper: Packaging (Android (ASTC)): C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Windows". Check to make sure the assembly exists on disk. If this reference is required by your code,
you may get compilation errors. [C:\Github\UnrealOculus\Engine\Source\Programs\AutomationTool\HoloLens\HoloLens.Automation.csproj]
UATHelper: Packaging (Android (ASTC)): C:\Github\UnrealOculus\Engine\Source\Programs\AutomationTool\HoloLens\HoloLensPlatform.Automation.cs(17,15): error CS0234: The type or namespace name 'Management' does not exist in the namespace 'Windows' (are you missing an assembly reference?) [C:\Github\UnrealOculus\Engine\Source\Programs\AutomationTool\HoloLe
ns\HoloLens.Automation.csproj]
I was packaging the app for the quest pro, not the hololens. But the automation tool got an error from something related to hololens. After googling [Link], I thought it might be caused by some additional settings I did for the quest pro after building the UE4.
First, I tried to build the automation tool only, but it showed a similar error to the above one. So I rebuilt the whole UE4 again. It took a while, but it did not work.
Then, I read attentively the scripts where the error occurred.
using Windows.Management.Deployment;
There was a red line under the Management package. And there were two functions that referred to it. Those caused errors. They were for hololens, and I was not going to use them, so I bypassed the problem by adding a few lines like this.
#if DISABLE_HOLOLENS
... problematic parts ...
#endif
It was built well.
However, now I got different errors from the avatar class as follows.
And I found out those variables and functions are removed in the recent commit. [Commit Diff Check]
I manually copied the explicitly required snippets checking the differences.
Then, those errors are gone..! Pheew..
After that I got another error.
UATHelper: Packaging (Android (ASTC)): ERROR: cmd.exe failed with args /c "C:\Github\UnrealOculus\Samples\Oculus\MovementSample\Intermediate\Android\arm64\gradle\rungradle.bat" :app:assembleDebug
I got this error because I did not set the SDK, NDK, JDK paths explicitly in the "Edit > Project Settings > Platforms > Android" in the UE4 editor. Also, there were remnants of Android SDK version 33, so I cleaned them with android studio and set the version to version 29.
Now, I succeeded in packaging. I tried to launch the app from the UE4 with the launch button, but it led to an error.
Running: C:\Users\for1m\AppData\Local\Android\Sdk\platform-tools\adb.exe -s 230YC01D8X02HU pull /sdcard/UE4Game/MovementSample/Manifest_UFSFiles_Android.txt "C:\Github\UnrealOculus\Samples\Oculus\MovementSample\Saved\StagedBuilds\Android_ASTC\Manifest_UFSFiles_Retrieved_Android_230YC01D8X02HU.txt"
LogPlayLevel: Took 0.0320736s to run adb.exe, ExitCode=1
LogPlayLevel: Error: ERROR: Failed retrieving UFS Manifest: adb: error: failed to stat remote object '/sdcard/UE4Game/MovementSample/Manifest_UFSFiles_Android.txt': No such file or directory
LogPlayLevel: ********** STAGE COMMAND COMPLETED **********
LogPlayLevel: ********** PACKAGE COMMAND STARTED **********
LogPlayLevel: ********** PACKAGE COMMAND COMPLETED **********
LogPlayLevel: ********** DEPLOY COMMAND STARTED **********
LogPlayLevel: Running: C:\Users\for1m\AppData\Local\Android\Sdk\platform-tools\adb.exe -s 230YC01D8X02HU shell getprop ro.product.cpu.abi
LogPlayLevel: Took 0.0511059s to run adb.exe, ExitCode=0
LogPlayLevel: Error: ERROR: System.NullReferenceException: Object reference not set to an instance of an object.
LogPlayLevel: at AndroidPlatform.IsPackagingforOculusMobile(DeploymentContext SC) in C:\Github\UnrealOculus\Engine\Source\Programs\AutomationTool\Android\AndroidPlatform.Automation.cs:line 2253
LogPlayLevel: at AndroidPlatform.Deploy(ProjectParams Params, DeploymentContext SC) in C:\Github\UnrealOculus\Engine\Source\Programs\AutomationTool\Android\AndroidPlatform.Automation.cs:line 1570
LogPlayLevel: at Project.Deploy(ProjectParams Params) in C:\Github\UnrealOculus\Engine\Source\Programs\AutomationTool\Scripts\DeployCommand.Automation.cs:line 54
LogPlayLevel: at BuildCookRun.DoBuildCookRun(ProjectParams Params) in C:\Github\UnrealOculus\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:line 219
LogPlayLevel: at BuildCookRun.ExecuteBuild() in C:\Github\UnrealOculus\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:line 39
LogPlayLevel: at AutomationTool.BuildCommand.Execute() in C:\Github\UnrealOculus\Engine\Source\Programs\AutomationTool\AutomationUtils\BuildCommand.cs:line 263
LogPlayLevel: at AutomationTool.Automation.Execute(List`1 CommandsToExecute, Dictionary`2 Commands) in C:\Github\UnrealOculus\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 547
LogPlayLevel: at AutomationTool.Automation.Process(String[] Arguments, StartupTraceListener StartupListener) in C:\Github\UnrealOculus\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 511
LogPlayLevel: at AutomationTool.Program.MainProc(String[] Arguments, StartupTraceListener StartupListener) in C:\Github\UnrealOculus\Engine\Source\Programs\AutomationTool\Program.cs:line 175
LogPlayLevel: at AutomationTool.Program.<>c__DisplayClass1_0.<Main>b__2() in C:\Github\UnrealOculus\Engine\Source\Programs\AutomationTool\Program.cs:line 87
LogPlayLevel: at AutomationTool.InternalUtils.RunSingleInstance(Func`1 Main) in C:\Github\UnrealOculus\Engine\Source\Programs\AutomationTool\AutomationUtils\Utils.cs:line 739
LogPlayLevel: at AutomationTool.Program.Main(String[] Arguments) in C:\Github\UnrealOculus\Engine\Source\Programs\AutomationTool\Program.cs:line 87
LogPlayLevel: (see C:\Github\UnrealOculus\Engine\Programs\AutomationTool\Saved\Logs\Log.txt for full exception trace)
LogPlayLevel: AutomationTool exiting with ExitCode=1 (Error_Unknown)
LogPlayLevel: Completed Launch On Stage: Deploy Task, Time: 1.503532
LogPlayLevel: BUILD FAILED
PackagingResults: Error: Launch failed! Unknown Error
Instead of directly launching from UE4, I could use the bat program in the package folder of ASTC. I had to find the app in the 'apps' view of the quest and check the 'allow unreliable sources' to see the app. But it did not work as intended and stuck with the black screen when I started the app.
They did not mention the SDK version explicitly as a cause, but the SDK version was different from what I set in the project setting. The engine used the path of the window environment variables. So I updated it to use the android API 29 and removed the remnants of the 33 and 28 versions with android studio and by myself (at the directory).
Now it built well and app started but there was another error message saying 'No google play store key'. [Link]
I tried the following 'Project Settings > Platforms/Android > Package game data inside .apk'.
It set the JDK to 1.8.0.
But it showed another error.
UATHelper: Packaging (Android (ASTC)): Z:\app\src\main\java\com\epicgames\ue4\WebViewControl.java:122: error: cannot find symbol
UATHelper: Packaging (Android (ASTC)): webView.getSettings().setAppCacheMaxSize( 10 * 1024 * 1024 );
UATHelper: Packaging (Android (ASTC)): ^
I checked the android studio, and there were 33 and 28 versions again..!
I removed them again and used the SetupAndroid and UpdateLinker in the UnrealEngine\Engine\Extras\Android.
Then I could build the app again.
But the app was still black when I tried on the quest.
So I tried another way, using the signing play store key rather than putting the game data inside .apk. [Link]
However, it didn't work.
Then I figured out there are 'verified' versions of commits in the repo!!!
I changed the commit version to the most recent and verified one, and rebuilt the engine. And finally it worked on the quest too!
'감각과 판단 Sensing and Judgment' 카테고리의 다른 글
UE4 Applying Facial, Eye, Body Tracking to Imported Avatar (0) | 2023.01.01 |
---|---|
Errors while building Unreal Engine 4 for Movement API (0) | 2022.12.24 |
How much of selfishness is allowed to one? (0) | 2022.05.27 |
가치함수 Value Function (0) | 2022.04.08 |
최적 정책 The Optimal Policy (0) | 2022.04.08 |