异常:java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Failed to allocate a 3112972 byte allocation with 2019776 free bytes and 1972KB until OOM
OOM:Android 内存溢出(Java的这个异常是指,内存申请失败,前面那个数字是你想申请分配的内存字节,后面的那个数是实际可用的系统内存,显然小于前者。)
解决方法:在清单文件中添加两行代码:
android:hardwareAccelerated="false"
android:largeHeap="true"
eg:
<application
android:name=".application.MyShowApplication"
android:allowBackup="true"
android:hardwareAccelerated="false"
android:icon="@mipmap/cat"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">

本文介绍了如何解决Android应用中常见的内存溢出问题。通过在清单文件中添加特定配置,可以有效避免因内存不足导致的应用崩溃。
5278

被折叠的 条评论
为什么被折叠?



