android.view.InflateException: Binary XML file line - how to avoid -
i have problem inflating, dont know how resolve because strange issue. got crash in basefragment
class in line 60. samsung , huawei devices(huawei gra_l09). code looks that:
public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { int contentview = onfragmentcontentview(); if(contentview == 0) throw new illegalargumentexception("onfragmentcontentview must not equal 0"); view layout = inflater.inflate(contentview, container, false); //!!line 60 butterknife.inject(this, layout); oncreatefragmentview(layout, container, savedinstancestate); return layout; }
i not sure reason maybe theme ? use theme.appcompat.light.
fatal exception: android.view.inflateexception: binary xml file line
2: error inflating class
@ android.view.layoutinflater.createview(layoutinflater.java:633) @ com.android.internal.policy.impl.phonelayoutinflater.oncreateview(phonelayoutinflater.java:55) @ android.view.layoutinflater.oncreateview(layoutinflater.java:682) @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:741) @ android.view.layoutinflater.parseinclude(layoutinflater.java:892) @ android.view.layoutinflater.rinflate(layoutinflater.java:802) @ android.view.layoutinflater.inflate(layoutinflater.java:504) @ android.view.layoutinflater.inflate(layoutinflater.java:414) @ com.vyda.stream.fragments.basefragment.oncreateview(basefragment.java:60) @ android.support.v4.app.fragment.performcreateview(fragment.java:1974) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1067) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1252) @ android.support.v4.app.backstackrecord.run(backstackrecord.java:738) @ android.support.v4.app.fragmentmanagerimpl.execpendingactions(fragmentmanager.java:1617) @ android.support.v4.app.fragmentmanagerimpl$1.run(fragmentmanager.java:517) @ android.os.handler.handlecallback(handler.java:739) @ android.os.handler.dispatchmessage(handler.java:95) @ android.os.looper.loop(looper.java:135) @ android.app.activitythread.main(activitythread.java:5254) @ java.lang.reflect.method.invoke(method.java) @ java.lang.reflect.method.invoke(method.java:372) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:763) @ java.lang.reflect.constructor.newinstance(constructor.java) @ java.lang.reflect.constructor.newinstance(constructor.java:288) @ android.view.layoutinflater.createview(layoutinflater.java:607) @ com.android.internal.policy.impl.phonelayoutinflater.oncreateview(phonelayoutinflater.java:55) @ android.view.layoutinflater.oncreateview(layoutinflater.java:682) @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:741) @ android.view.layoutinflater.parseinclude(layoutinflater.java:892) @ android.view.layoutinflater.rinflate(layoutinflater.java:802) @ android.view.layoutinflater.inflate(layoutinflater.java:504) @ android.view.layoutinflater.inflate(layoutinflater.java:414) @ com.vyda.stream.fragments.basefragment.oncreateview(basefragment.java:60) @ android.support.v4.app.fragment.performcreateview(fragment.java:1974) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1067) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1252) @ android.support.v4.app.backstackrecord.run(backstackrecord.java:738) @ android.support.v4.app.fragmentmanagerimpl.execpendingactions(fragmentmanager.java:1617) @ android.support.v4.app.fragmentmanagerimpl$1.run(fragmentmanager.java:517) @ android.os.handler.handlecallback(handler.java:739) @ android.os.handler.dispatchmessage(handler.java:95) @ android.os.looper.loop(looper.java:135) @ android.app.activitythread.main(activitythread.java:5254) @ java.lang.reflect.method.invoke(method.java) @ java.lang.reflect.method.invoke(method.java:372) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:977) > byte allocation 3357954 free bytes , 3mb until oom @ com.android.internal.os.zygoteinit.main(zygoteinit.java:763) @ dalvik.system.vmruntime.newnonmovablearray(vmruntime.java) @ android.graphics.bitmapfactory.nativedecodeasset(bitmapfactory.java) @ android.graphics.bitmapfactory.decodestream(bitmapfactory.java:609) @ android.graphics.bitmapfactory.decoderesourcestream(bitmapfactory.java:444) @ android.graphics.drawable.drawable.createfromresourcestream(drawable.java:988) @ android.content.res.resources.loaddrawableforcookie(resources.java:2480) @ android.content.res.resources.loaddrawable(resources.java:2387) @ android.content.res.typedarray.getdrawable(typedarray.java:749) @ android.view.view.<init>(view.java:3754) @ android.view.viewgroup.<init>(viewgroup.java:498) @ android.widget.relativelayout.<init>(relativelayout.java:249) @ android.widget.relativelayout.<init>(relativelayout.java:245) @ android.widget.relativelayout.<init>(relativelayout.java:241) @ java.lang.reflect.constructor.newinstance(constructor.java) @ java.lang.reflect.constructor.newinstance(constructor.java:288) @ android.view.layoutinflater.createview(layoutinflater.java:607) @ com.android.internal.policy.impl.phonelayoutinflater.oncreateview(phonelayoutinflater.java:55) @ android.view.layoutinflater.oncreateview(layoutinflater.java:682) @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:741) @ android.view.layoutinflater.parseinclude(layoutinflater.java:892) @ android.view.layoutinflater.rinflate(layoutinflater.java:802) @ android.view.layoutinflater.inflate(layoutinflater.java:504) @ android.view.layoutinflater.inflate(layoutinflater.java:414) @ com.vyda.stream.fragments.basefragment.oncreateview(basefragment.java:60) @ android.support.v4.app.fragment.performcreateview(fragment.java:1974) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1067) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1252) @ android.support.v4.app.backstackrecord.run(backstackrecord.java:738) @ android.support.v4.app.fragmentmanagerimpl.execpendingactions(fragmentmanager.java:1617) @ android.support.v4.app.fragmentmanagerimpl$1.run(fragmentmanager.java:517) @ android.os.handler.handlecallback(handler.java:739) @ android.os.handler.dispatchmessage(handler.java:95) @ android.os.looper.loop(looper.java:135) @ android.app.activitythread.main(activitythread.java:5254) @ java.lang.reflect.method.invoke(method.java) @ java.lang.reflect.method.invoke(method.java:372) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:977) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:763)
[edit]: whole class code: http://pastebin.com/nscpy35y
add this:
android:largeheap="true"
in manifest file avoid oom error.
Comments
Post a Comment