将BuildTools从23升级到27后,我面临着崩溃问题。
我已经在分析器中检查了RAM使用情况 - 没有异常。 应用程序有时在后台崩溃,有时在前台崩溃,在不同的活动中崩溃(崩溃是完全不确定的),看起来似乎不取决于内存使用情况(可以在使用350mb和200mb时都崩溃)
我还安装了'square/leakcanary'来查找任何内存泄漏,但没有发现任何问题...
似乎存在加载本地typeface的问题。 我在三星S9和三星S5上设法使应用程序崩溃。 有什么想法? :(
谢谢任何帮助!
Stacktrace:
2018-10-05 08:09:04.740 20542-20542/pl.chillout.debug E/AndroidRuntime: FATAL EXCEPTION: main
Process: pl.chillout.debug, PID: 20542
java.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)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)