美文网首页
安卓内存溢出,APP闪退

安卓内存溢出,APP闪退

作者: 可乐_加冰_ | 来源:发表于2020-12-21 15:10 被阅读0次

报错提示:Failed to allocate a 43848012 byte allocation with 16777216 free bytes and 38MB until OOM........

摘自:https://stackoverflow.com/questions/36652716/java-lang-outofmemoryerror-failed-to-allocate-a-36000012-byte-allocation-with-1

解决方案①

在清单文件 AndroidManifest.xml 文件 application 标签中加入代码

<application
android:largeHeap="true"
android:hardwareAccelerated="false"
>
方案②
如果方案一未能生效,考虑更换项目中引入res/drawable目录下的文件资源(或者图片资源)。将资源移动到res/mipmap-hdpi目录下试试。

即不使用drawable目录存放文件(该目录下存放文件过大,可能导致内存溢出)

相关文章

网友评论

      本文标题:安卓内存溢出,APP闪退

      本文链接:https://www.haomeiwen.com/subject/ccbrnktx.html