Unreal Engine 4 Android Armv7a 打包错误

Unreal Engine 4 Android Armv7a Packaging Error

我正在尝试打包一个包含对 Armv7a 的支持的项目,但无法成功,因为它向我抛出异常。如果我在 Unreal Engine 4.27.2.

中取消选中包项目 window 中的选项,我就能够成功地为 arm64 打包

我也一直在通过互联网进行研究,但就是找不到解决方案,他们提出的解决方案是使用“-fno-exceptions”一起禁用异常,但这似乎也不起作用。

错误是构建.so for armv7 如下:

`UATHelper: Packaging (Android (ETC2)):   PLATFORM_ANDROID_NDK_VERSION = 230100
UATHelper: Packaging (Android (ETC2)):   NDK toolchain: r23, NDK version: 31, GccVersion: 4.9, ClangVersion: 12.0.5
UATHelper: Packaging (Android (ETC2)):   Compiling Native 32-bit code with NDK API 'android-31'
UATHelper: Packaging (Android (ETC2)):   Compiling Native 64-bit code with NDK API 'android-31'
UATHelper: Packaging (Android (ETC2)):   Writing manifest to C:\Users\User1\Documents\Unreal Projects\Demo3AndroidCpp\Intermediate\Build\Manifest.xml
UATHelper: Packaging (Android (ETC2)):   Building Demo3AndroidCpp...
UATHelper: Packaging (Android (ETC2)):   Building 2 actions with 8 processes...
UATHelper: Packaging (Android (ETC2)):     [1/2] Demo3AndroidCpp-armv7.so
UATHelper: Packaging (Android (ETC2)):     ld.lld: error: undefined symbol: __aeabi_unwind_cpp_pr1
UATHelper: Packaging (Android (ETC2)):     >>> referenced by Module.Launch.cpp
UATHelper: Packaging (Android (ETC2)):     >>>               C:/Program Files/Epic Games/UE_4.27/Engine/Intermediate/Build/Android/UE4/Development/Launch/Module.Launch.cppa7.o:(.ARM.exidx.text._ZN16FAppEventManager11GetInstanceEv+0x0)
UATHelper: Packaging (Android (ETC2)):     >>> referenced by Module.Launch.cpp
UATHelper: Packaging (Android (ETC2)):     >>>               C:/Program Files/Epic Games/UE_4.27/Engine/Intermediate/Build/Android/UE4/Development/Launch/Module.Launch.cppa7.o:(.ARM.exidx.text._ZN16FAppEventManager15DequeueAppEventEv+0x0)
UATHelper: Packaging (Android (ETC2)):     >>> referenced by Module.Launch.cpp
UATHelper: Packaging (Android (ETC2)):     >>>               C:/Program Files/Epic Games/UE_4.27/Engine/Intermediate/Build/Android/UE4/Development/Launch/Module.Launch.cppa7.o:(.ARM.exidx.text._ZN16FAppEventManager17ReleaseMicrophoneEb+0x0)
UATHelper: Packaging (Android (ETC2)):     >>> referenced 161000 more times
UATHelper: Packaging (Android (ETC2)):   
UATHelper: Packaging (Android (ETC2)):     ld.lld: error: undefined symbol: __aeabi_unwind_cpp_pr0
UATHelper: Packaging (Android (ETC2)):     >>> referenced by Module.Launch.cpp
UATHelper: Packaging (Android (ETC2)):     >>>               C:/Program Files/Epic Games/UE_4.27/Engine/Intermediate/Build/Android/UE4/Development/Launch/Module.Launch.cppa7.o:(.ARM.exidx.text._ZN16FAppEventManager4TickEv+0x0)
UATHelper: Packaging (Android (ETC2)):     >>> referenced by Module.Launch.cpp
UATHelper: Packaging (Android (ETC2)):     >>>               C:/Program Files/Epic Games/UE_4.27/Engine/Intermediate/Build/Android/UE4/Development/Launch/Module.Launch.cppa7.o:(.ARM.exidx.text._ZZN16FAppEventManager4TickEvEN4Impl21ExecCheckImplInternalEv+0x0)
UATHelper: Packaging (Android (ETC2)):     >>> referenced by Module.Launch.cpp
UATHelper: Packaging (Android (ETC2)):     >>>               C:/Program Files/Epic Games/UE_4.27/Engine/Intermediate/Build/Android/UE4/Development/Launch/Module.Launch.cppa7.o:(.ARM.exidx.text._ZN16FAppEventManager17ExecWindowResizedEv+0x0)
UATHelper: Packaging (Android (ETC2)):     >>> referenced 369570 more times
UATHelper: Packaging (Android (ETC2)):     clang++: error: linker command failed with exit code 1 (use -v to see invocation)
PackagingResults: Error: undefined symbol: __aeabi_unwind_cpp_pr1
PackagingResults: Error: undefined symbol: __aeabi_unwind_cpp_pr0
PackagingResults: Error: linker command failed with exit code 1 (use -v to see invocation)
UATHelper: Packaging (Android (ETC2)): Took 32.2903757s to run UnrealBuildTool.exe, ExitCode=6
UATHelper: Packaging (Android (ETC2)): UnrealBuildTool failed. See log for more details. (C:\Users\User1\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.27\UBT-Demo3AndroidCpp-Android-Development.txt)
UATHelper: Packaging (Android (ETC2)): AutomationTool exiting with ExitCode=6 (6)
UATHelper: Packaging (Android (ETC2)): BUILD FAILED
PackagingResults: Error: Unknown Error`

由于arm32包错误,我目前只能支持有限数量的设备。

根据 UE4 文档,正确的解决方案是适当的兼容性。

UE 引擎 v4.27.2 支持 NDK v21.4e,我之前尝试使用 v23.0。 下载并更改为 v21.4e 后,我能够成功编译 armv7a 设备。