为了账号安全,请及时绑定邮箱和手机立即绑定

布局文件图片加载导致内存溢出,三个不同的真机出现了三种不同的报错信息,求解决办法

布局文件图片加载导致内存溢出,三个不同的真机出现了三种不同的报错信息,求解决办法

飞翔_0026 2016-01-20 21:06:07
01-20 20:53:56.336  13646-13646/? E/art﹕ Throwing OutOfMemoryError "Failed to allocate a 37748748 byte allocation with 1439808 free bytes and 1406KB until OOM"01-20 20:53:56.339  13646-13646/? E/AndroidRuntime﹕ FATAL EXCEPTION: main    Process: i_dreaming.com.idream, PID: 13646    java.lang.RuntimeException: Unable to start activity ComponentInfo{i_dreaming.com.idream/i_dreaming.com.idream.IDream}: android.view.InflateException: Binary XML file line #37: Error inflating class <unknown>            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2462)            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2524)            at android.app.ActivityThread.access$800(ActivityThread.java:167)            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1419)            at android.os.Handler.dispatchMessage(Handler.java:111)            at android.os.Looper.loop(Looper.java:194)            at android.app.ActivityThread.main(ActivityThread.java:5546)            at java.lang.reflect.Method.invoke(Native Method)            at java.lang.reflect.Method.invoke(Method.java:372)            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)     Caused by: android.view.InflateException: Binary XML file line #37: Error inflating class <unknown>            at android.view.LayoutInflater.createView(LayoutInflater.java:637)            at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)            at android.view.LayoutInflater.onCreateView(LayoutInflater.java:686)            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:745)            at android.view.LayoutInflater.rInflate(LayoutInflater.java:810)            at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)            at android.view.LayoutInflater.parseInclude(LayoutInflater.java:920)            at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)            at android.view.LayoutInflater.inflate(LayoutInflater.java:508)            at android.view.LayoutInflater.inflate(LayoutInflater.java:418)            at android.view.LayoutInflater.inflate(LayoutInflater.java:365)            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:400)            at android.app.Activity.setContentView(Activity.java:2170)            at i_dreaming.com.idream.IDream.onCreate(IDream.java:37)            at android.app.Activity.performCreate(Activity.java:5977)            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111)            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2415)            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2524)            at android.app.ActivityThread.access$800(ActivityThread.java:167)            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1419)            at android.os.Handler.dispatchMessage(Handler.java:111)            at android.os.Looper.loop(Looper.java:194)            at android.app.ActivityThread.main(ActivityThread.java:5546)            at java.lang.reflect.Method.invoke(Native Method)            at java.lang.reflect.Method.invoke(Method.java:372)            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)     Caused by: java.lang.reflect.InvocationTargetException            at java.lang.reflect.Constructor.newInstance(Native Method)            at java.lang.reflect.Constructor.newInstance(Constructor.java:288)            at android.view.LayoutInflater.createView(LayoutInflater.java:611)            at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)            at android.view.LayoutInflater.onCreateView(LayoutInflater.java:686)            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:745)            at android.view.LayoutInflater.rInflate(LayoutInflater.java:810)            at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)            at android.view.LayoutInflater.parseInclude(LayoutInflater.java:920)            at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)            at android.view.LayoutInflater.inflate(LayoutInflater.java:508)            at android.view.LayoutInflater.inflate(LayoutInflater.java:418)            at android.view.LayoutInflater.inflate(LayoutInflater.java:365)            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:400)            at android.app.Activity.setContentView(Activity.java:2170)            at i_dreaming.com.idream.IDream.onCreate(IDream.java:37)            at android.app.Activity.performCreate(Activity.java:5977)            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111)            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2415)            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2524)            at android.app.ActivityThread.access$800(ActivityThread.java:167)            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1419)            at android.os.Handler.dispatchMessage(Handler.java:111)            at android.os.Looper.loop(Looper.java:194)            at android.app.ActivityThread.main(ActivityThread.java:5546)            at java.lang.reflect.Method.invoke(Native Method)            at java.lang.reflect.Method.invoke(Method.java:372)            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)     Caused by: java.lang.OutOfMemoryError: Failed to allocate a 37748748 byte allocation with 1439808 free bytes and 1406KB until OOM            at dalvik.system.VMRuntime.newNonMovableArray(Native Method)            at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)            at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:655)            at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:488)            at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:978)            at android.content.res.Resources.createFromResourceStream(Resources.java:3016)            at android.content.res.Resources.loadDrawableForCookie(Resources.java:2711)            at android.content.res.Resources.loadDrawable(Resources.java:2597)            at android.content.res.MiuiResources.loadDrawable(MiuiResources.java:348)            at android.content.res.TypedArray.getDrawable(TypedArray.java:751)            at android.widget.ImageView.<init>(ImageView.java:146)            at android.widget.ImageView.<init>(ImageView.java:135)            at android.widget.ImageView.<init>(ImageView.java:131)            at java.lang.reflect.Constructor.newInstance(Native Method)            at java.lang.reflect.Constructor.newInstance(Constructor.java:288)            at android.view.LayoutInflater.createView(LayoutInflater.java:611)            at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)            at android.view.LayoutInflater.onCreateView(LayoutInflater.java:686)            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:745)            at android.view.LayoutInflater.rInflate(LayoutInflater.java:810)            at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)            at android.view.LayoutInflater.parseInclude(LayoutInflater.java:920)            at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)            at android.view.LayoutInflater.inflate(LayoutInflater.java:508)            at android.view.LayoutInflater.inflate(LayoutInflater.java:418)            at android.view.LayoutInflater.inflate(LayoutInflater.java:365)            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:400)            at android.app.Activity.setContentView(Activity.java:2170)            at i_dreaming.com.idream.IDream.onCreate(IDream.java:37)            at android.app.Activity.performCreate(Activity.java:5977)            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111)            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2415)            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2524)            at android.app.ActivityThread.access$800(ActivityThread.java:167)            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1419)            at android.os.Handler.dispatchMessage(Handler.java:111)            at android.os.Looper.loop(Looper.java:194)            at android.app.ActivityThread.main(ActivityThread.java:5546)            at java.lang.reflect.Method.invoke(Native Method)            at java.lang.reflect.Method.invoke(Method.java:372)            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)
查看完整描述

2 回答

?
dky

TA贡献93条经验 获得超26个赞

Imageloader去看看它的源码

查看完整回答
反对 回复 2016-09-08
  • 2 回答
  • 0 关注
  • 3612 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信