java.lang.RuntimeException: Unable to start activity ComponentInfo{bt4u.com.pokemonbattles/bt4u.com.pokemonbattles.MainActivity}: android.view.InflateException: Binary XML file line #21: Error inflating class <unknown>

tip

Try adding these lines to your manifest: "android:hardwareAccelerated="false"" and "android:largeHeap="true"" as it seems to work for some cases. See also this article about handling bitmaps on android's documentation: https://goo.gl/8LVrzp

tip

Try adding these lines to your manifest: "android:hardwareAccelerated="false"" and "android:largeHeap="true"" as it seems to work for some cases. See also this article about handling bitmaps on android's documentation: https://goo.gl/8LVrzp

tip

Try adding these lines to your manifest: "android:hardwareAccelerated="false"" and "android:largeHeap="true"" as it seems to work for some cases. See also this article about handling bitmaps on android's documentation: https://goo.gl/8LVrzp

tip

Try adding these lines to your manifest: "android:hardwareAccelerated="false"" and "android:largeHeap="true"" as it seems to work for some cases. See also this article about handling bitmaps on android's documentation: https://goo.gl/8LVrzp

tip

Try adding these lines to your manifest: "android:hardwareAccelerated="false"" and "android:largeHeap="true"" as it seems to work for some cases. See also this article about handling bitmaps on android's documentation: https://goo.gl/8LVrzp

tip

Try adding these lines to your manifest: "android:hardwareAccelerated="false"" and "android:largeHeap="true"" as it seems to work for some cases. See also this article about handling bitmaps on android's documentation: https://goo.gl/8LVrzp

tip

Try adding these lines to your manifest: "android:hardwareAccelerated="false"" and "android:largeHeap="true"" as it seems to work for some cases. See also this article about handling bitmaps on android's documentation: https://goo.gl/8LVrzp

tip

Try adding these lines to your manifest: "android:hardwareAccelerated="false"" and "android:largeHeap="true"" as it seems to work for some cases. See also this article about handling bitmaps on android's documentation: https://goo.gl/8LVrzp

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Listview out of memory exception in viewholder
    via Stack Overflow by james
    ,
  • google maps api v2 out of memory error
    via Stack Overflow by Salivan
    ,
    • java.lang.RuntimeException: Unable to start activity ComponentInfo{bt4u.com.pokemonbattles/bt4u.com.pokemonbattles.MainActivity}: android.view.InflateException: Binary XML file line #21: Error inflating class <unknown> at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2394) at android.app.ActivityThread.access$800(ActivityThread.java:154) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5276) 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:911) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706) Caused by: android.view.InflateException: Binary XML file line #21: Error inflating class <unknown> t 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.inflate(LayoutInflater.java:508) at android.view.LayoutInflater.inflate(LayoutInflater.java:418) at android.view.LayoutInflater.inflate(LayoutInflater.java:365) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) at bt4u.com.pokemonbattles.MainActivity.onCreate(MainActivity.java:47) at android.app.Activity.performCreate(Activity.java:6041) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1109) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2285) ... 10 more 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) ... 23 more Caused by: java.lang.OutOfMemoryError: Failed to allocate a 20971884 byte allocation with 16777120 free bytes and 19MB until OOM at dalvik.system.VMRuntime.newNonMovableArray(Native Method) at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:613) at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:446) at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:988) at android.content.res.Resources.createFromResourceStream(Resources.java:2822) at android.content.res.Resources.loadDrawableForCookie(Resources.java:2523) at android.content.res.Resources.loadDrawable(Resources.java:2421) at android.content.res.MiuiResources.loadDrawable(MiuiResources.java:393) at android.content.res.TypedArray.getDrawable(TypedArray.java:751) at android.view.View.<init>(View.java:3740) at android.view.ViewGroup.<init>(ViewGroup.java:498) at android.widget.GridLayout.<init>(GridLayout.java:285) at android.widget.GridLayout.<init>(GridLayout.java:281) at android.widget.GridLayout.<init>(GridLayout.java:277) ... 26 more

    Users with the same issue

    filpgame
    filpgame8 times, last one,
    Aria Pahlavan
    Aria Pahlavan24 times, last one,
    pranavprakash
    pranavprakash2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    65 more bugmates