当前位置: 代码迷 >> 综合 >> (UE4)安卓打包,报 Exception in thread “main“ java.lang.NullPointerException at org.gradle.wrapper...
  详细解决方案

(UE4)安卓打包,报 Exception in thread “main“ java.lang.NullPointerException at org.gradle.wrapper...

热度:47   发布时间:2024-02-12 02:41:48.0
  • 错误信息
UATHelper: Packaging (Android (ASTC)): Creating rungradle.bat to work around commandline length limit (using unused drive letter Z:)
UATHelper: Packaging (Android (ASTC)): Making .apk with Gradle...
UATHelper: Packaging (Android (ASTC)): Exception in thread "main" java.lang.NullPointerException
UATHelper: Packaging (Android (ASTC)):     at org.gradle.wrapper.BootstrapMainStarter.findLauncherJar(BootstrapMainStarter.java:34)
UATHelper: Packaging (Android (ASTC)):     at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:25)
UATHelper: Packaging (Android (ASTC)):     at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
UATHelper: Packaging (Android (ASTC)):     at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
UATHelper: Packaging (Android (ASTC)): ERROR: C:\WINDOWS\system32\cmd.exe failed with args /c "E:\Photograph\TestAndroid\Intermediate/Android/APK\gradle\rungradle.bat" :app:assembleDebug
UATHelper: Packaging (Android (ASTC)):        (see C:\Users\Administrator\AppData\Roaming\Unreal Engine\AutomationTool\Logs\E+Program+Files+Epic+Games+UE_4.22\Log.txt for full exception trace)
UATHelper: Packaging (Android (ASTC)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Android (ASTC)): BUILD FAILE
  • 环境
  1. UE4.22 AndroidSDK环境正常配置;
  2. 未安装android studio;
  3. 打包使用的gradle版本为4.1.
  • 解决方案
    自行下载gradle-4.1-all.zip,删除旧包及解压文件夹,用自己下的包替换并解压;
    在这里插入图片描述
    原因可能为自动下载的gradle包不完整或有其它问题.
  相关解决方案