UE4 安卓打包失败“Build-tool 31.0.0 is missing DX”

UATHelper: 打包 (Android(多个:ASTC,DXT,ETC2)): Build-tool 31.0.0 is missing DX at D:\Android\sdk\build-tools\31.0.0\dx.bat
UATHelper: 打包 (Android(多个:ASTC,DXT,ETC2)): FAILURE: Build failed with an exception.
UATHelper: 打包 (Android(多个:ASTC,DXT,ETC2)): * What went wrong:
UATHelper: 打包 (Android(多个:ASTC,DXT,ETC2)): Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
UATHelper: 打包 (Android(多个:ASTC,DXT,ETC2)): > Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.
UATHelper: 打包 (Android(多个:ASTC,DXT,ETC2)): * Try:
UATHelper: 打包 (Android(多个:ASTC,DXT,ETC2)): Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
UATHelper: 打包 (Android(多个:ASTC,DXT,ETC2)): * Get more help at https://help.gradle.org
UATHelper: 打包 (Android(多个:ASTC,DXT,ETC2)): BUILD FAILED in 35s
UATHelper: 打包 (Android(多个:ASTC,DXT,ETC2)): ERROR: cmd.exe failed with args /c "E:\code\Unreal\MyFPS\Intermediate\Android\armv7\gradle\rungradle.bat" :app:assembleDebug
UATHelper: 打包 (Android(多个:ASTC,DXT,ETC2)):        (see C:\Users\zmk\AppData\Roaming\Unreal Engine\AutomationTool\Logs\d+Epic+Games+UE_4.27\Log.txt for full exception trace)
UATHelper: 打包 (Android(多个:ASTC,DXT,ETC2)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: 打包 (Android(多个:ASTC,DXT,ETC2)): BUILD FAILED

分析

Build-tool 31.0.0 is missing DX

解决

Build Tool 31 以后从SDK内删除了DX工具,使用D8工具来替代DX工具。

解决方法有:

  1. 使用build tool 30。
  2. 从build tool 30内复制DX工具到build tool 31。
  3. 升级Android Gradle Plugin 到7.x

这里选择的是第一种方法。

选择编辑=>项目设置=>平台=>Android SDK,修改SDK API Level为30.0.3.1

UE4 安卓打包失败“Build-tool 31.0.0 is missing DX”_第1张图片


  1. Android Studio error “Installed Build Tools revision 31.0.0 is corrupted” - Stack Overflow https://stackoverflow.com/questions/68387270/android-studio-error-installed-build-tools-revision-31-0-0-is-corrupted ↩︎

你可能感兴趣的:(Unreal,Engine,ue4,android,unreal)