Unity 报错之 打包安卓闪退 Could not allocate memory: System out of memory

Posted 陈言必行

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Unity 报错之 打包安卓闪退 Could not allocate memory: System out of memory相关的知识,希望对你有一定的参考价值。

Unity 报错之 打包安卓闪退 Could not allocate memory: System out of memory

问题背景

更换机器打包,打包机器上没有开发使用的Unity版本,所以更换了Unity2019.4.8f1版本进行导出安卓工程,在安卓工程中打包出现闪退问题。

闪退报错

Unity: Could not allocate memory: System out of memory!
Trying to allocate: 4227858432B with 16 alignment. MemoryLabel: DynamicArray
Allocation happened at: Line:78 in
Memory overview

[ ALLOC_TEMP_THREAD ] used: 32768B | peak: 0B | reserved: 3538944B 
[ ALLOC_TEMP_JOB_1_FRAME ] used: 0B | peak: 0B | reserved: 1048576B 
[ ALLOC_TEMP_JOB_2_FRAMES ] used: 0B | peak: 0B | reserved: 1048576B 
[ ALLOC_TEMP_JOB_4_FRAMES ] used: 0B | peak: 0B | reserved: 1048576B 
[ ALLOC_TEMP_JOB_ASYNC ] used: 0B | peak: 0B | reserved: 1048576B 
[ ALLOC_DEFAULT ] used: 3638090B | peak: 3638090B | reserved: 3858110B 
[ ALLOC_GAMEOBJECT ] used: 809064B | peak: 809064B | reserved: 809216B 
[ ALLOC_GFX ] used: 256B | peak: 256B | reserved: 313B 

解决问题

更换了Unity版本。

经过不断地尝试,我将Unity版本修改到打包机上有的Unity2019.4.13f1,再次进行同样的操作就解决问题了。

推测是Unity2019.4.8f1的版本和之前开发版本相差略大导致的问题。

以上是关于Unity 报错之 打包安卓闪退 Could not allocate memory: System out of memory的主要内容,如果未能解决你的问题,请参考以下文章

Unity 报错之 接入YomboTGSDK后打包报错:mainTemplate.gradle needs to be updated(property ‘unityStreamingAssets‘)

Unity 报错之 接入YomboTGSDK后打包报错:mainTemplate.gradle needs to be updated(property ‘unityStreamingAssets‘)

Unity报错之 No Sprite Editor Window registered. Please download 2D Sprite package from Package Manager.

composer install报错之it could not be found in any version

saiku 3.8 二次开发报错之Could not start repo 找不到configuration.xml文件

Unity报错之UnityException: Texture ‘XXX‘ is not readable