zifa2003293 发表于 2022-11-20 20:36

Unreal 4.26 安卓打包

环境准备

UE4版本4.26.1 Android Studio Download Android Studio and SDK tools NDK android-ndk-r21e CodeWorks for Android 需要先注册账户

image.png


引擎配置


打包设置

报错处理

安卓SDK 不匹配


更新安卓SDK


拷贝







[*]
打开 …\UE_4.25\Engine\Source\ThirdParty\GoogleGameSDK
Get a copy of GoogleGameSDK.Build.cs
假如你需要 build arm64; remove this => PublicAdditionalLibraries.Add(GoogleGameSDKPath + “/gamesdk/libs/armeabi-v7a_API24_NDK21_cpp_shared_Release/libgamesdk.a”)

假如你需要 build armv7, remove this => PublicAdditionalLibraries.Add(GoogleGameSDKPath + “/gamesdk/libs/arm64-v8a_API24_NDK21_cpp_shared_Release/libgamesdk.a”);

ERROR: \Android\arm64\gradle\rungradle.bat" :app:assembleDebug   unreal gradle error 内存溢出

gradle 内存溢出,报* What went wrong:


   Execution failed for task ':app:packageDebug'.    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade    java.lang.OutOfMemoryError (no error message)
找到 Engine\Source\Programs\UnrealBuildTool\Platform\Android\UEDeployAndroid.cs 文件 如下图:调大 -XX 和 -Xmx
    GradleProperties.AppendLine("org.gradle.jvmargs=-XX:MaxHeapSize=1024m -Xmx2048m");
页: [1]
查看完整版本: Unreal 4.26 安卓打包