将 BuildTools 从 23 升级到 27 后,我遇到了崩溃问题。我在探查器中检查了 RAM 使用情况 - 那里没有异常。应用程序有时在后台崩溃,有时在前台崩溃,在不同的活动中(崩溃是完全不确定的),它似乎不依赖于内存使用情况(能够像 200mb 一样使用 350mb 崩溃)我还安装了“square/leakcanary”来查找任何内存泄漏,但什么也没有......似乎是加载原生字体的问题。我不在此应用程序中使用自定义字体。我设法使三星 S9 和三星 S5 上的应用程序崩溃。有任何想法吗?:(谢谢你的帮助!堆栈跟踪:2018-10-05 08:09:04.740 20542-20542/pl.chillout.debug E/AndroidRuntime: FATAL EXCEPTION: mainProcess: pl.chillout.debug, PID: 20542java.lang.OutOfMemoryError: EnsureLocalCapacity at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:200) at java.io.FileInputStream.<init>(FileInputStream.java:150) at android.graphics.Typeface.getFullFlipFont(Typeface.java:1275) at android.graphics.Typeface.getFontPathFlipFont(Typeface.java:1220) at android.graphics.Typeface.SetFlipFonts(Typeface.java:1413) at android.graphics.Typeface.SetAppTypeFace(Typeface.java:1547) at android.app.Activity.onCreate(Activity.java:1020) at android.support.v4.app.SupportActivity.onCreate(SupportActivity.java:66) at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:321) at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:84) at pl.chillout.redesign.activity.BaseDrawerActivity.onCreate(BaseDrawerActivity.java:45) at pl.chillout.redesign.activity.ChilloutActivity.onCreate(ChilloutActivity.java:115) at android.app.Activity.performCreate(Activity.java:7174) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2908) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6938)
3 回答
喵喔喔
TA贡献1735条经验 获得超5个赞
这种情况的原因可能是您正在使用这样的静态对象:
private static TextView textView; //DO NOT DO THIS
private static Context context; //DO NOT DO THIS
这是内存泄漏的第一个迹象。
不幸的是没有完整的代码
眼眸繁星
TA贡献1873条经验 获得超9个赞
亲爱的,在清单中添加 largeheap=true。然后完成开始的活动。并检查您的可绘制尺寸(大小)。我在 PagerView 中遇到了这个问题。我调整可绘制图像的大小。并完成所有活动。和大堆现在崩溃被删除。我认为您的错误与 orio 设备有关,请初始化 orio 设备的所有对象。
添加回答
举报
0/150
提交
取消