Unreal Engine (UE) 4.6 android build error PowerManager

问题

按照Unreal官方推荐配置好安卓开发后,构建失败,报错中含有GameActivity.java PowerManager相关错误信息:

涉及PowerManager的报错信息

原因

这可能是由于SDK Platforms引起的,默认UE会自动安装和使用android-28,但*** GameActivity.java ***中的某些代码可能需要android-29,因此安装29即可解决错误。

解决

可能需要无碍访问互联网。但也不一定。

更直接的解决方法就是安装最新的sdk platform。

以下是可以成功打包的Android SDK的配置,主要为:

  • Android SDK Platform 30
  • Android SDK Build-Tools 30.0.3
  • NDK 21.1.6352462
  • Android SDK Command-line Tools(lastest) 3.0
  • Android SDK Platform-Tools 30.0.5
  • Android SDK Tools 26.1.1
SDK Platforms仅30
Build Tools仅30.0.3
Command-line Tools仅3.0(latest)
Platform-Tools & Tools

以下内容未备注,无需关注

未安装任何SDK Platforms,Launch时会出下面的错误:

LogPlayLevel: ====2021/2/5 12:31:12====PREPARING TO MAKE APK=================================================================
LogPlayLevel: bBuildForES31: true
LogPlayLevel: bSupportsVulkan: false
LogPlayLevel: Error: ERROR: Can't make an APK without an API installed (D:/APPs/Android/SDK/platforms does not contain any SDKs)
LogPlayLevel:        (see C:\Users\Admin\AppData\Roaming\Unreal Engine\AutomationTool\Logs\E+_LINKs+D_APPs_LINKs+Unreal+Engine+UE_4.26\Log.txt for full exception trace)
LogPlayLevel: Completed Launch On Stage: Build Task, Time: 4.027662
LogPlayLevel: AutomationTool exiting with ExitCode=1 (Error_Unknown)
LogPlayLevel: BUILD FAILED
PackagingResults: Error: Launch failed! Unknown Error

未安装任何SDK Build Tools,会报下面的错误:

LogPlayLevel: ====2021/2/5 12:35:13====PREPARING TO MAKE APK=================================================================
LogPlayLevel: bBuildForES31: true
LogPlayLevel: bSupportsVulkan: false
LogPlayLevel: Building Java with SDK API level 'android-30'
LogPlayLevel: Error: ERROR: Failed to find %ANDROID_HOME%/build-tools subdirectory. Run SDK manager and install build-tools.
LogPlayLevel:        (see C:\Users\Admin\AppData\Roaming\Unreal Engine\AutomationTool\Logs\E+_LINKs+D_APPs_LINKs+Unreal+Engine+UE_4.26\Log.txt for full exception trace)
LogPlayLevel: AutomationTool exiting with ExitCode=1 (Error_Unknown)
LogPlayLevel: Completed Launch On Stage: Build Task, Time: 4.025715
LogPlayLevel: BUILD FAILED
PackagingResults: Error: Launch failed! Unknown Error

你可能感兴趣的:(Unreal Engine (UE) 4.6 android build error PowerManager)