Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Android报错:java.lang.OutOfMemoryError: Failed to allocate a 74126220 byte allocation with 4190480 free bytes and 61MB until OOM大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

错误代码

  java.lang.outOfMemoryError: Failed to allocate a 74126220 byte alLOCATIOn with 4190480 free bytes and 61MB until OOM

错误原因:

  内存超了

解决方法

  1、处理图片和视频减少加载量

  2、开启多个线程,避免所有处理都在主线程中处理

  3、在AndroidManifest.xml文件中的application标签添加如下四行代码解决问题了

  android:allowBACkup="true"   android:supportsRtl="true"   android:largeHeap="true"   android:hardwareAccelerated="false"
如下:
<application
    android:allowBACkup="true"
    android:hardwareAccelerated="false"
    android:icon="@mipmap/ic_launcher"
    android:label="@String/app_name"
    android:largeHeap="true"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

大佬总结

以上是大佬教程为你收集整理的Android报错:java.lang.OutOfMemoryError: Failed to allocate a 74126220 byte allocation with 4190480 free bytes and 61MB until OOM全部内容,希望文章能够帮你解决Android报错:java.lang.OutOfMemoryError: Failed to allocate a 74126220 byte allocation with 4190480 free bytes and 61MB until OOM所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。