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
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    App closing with exception on all Mi devices(On MIUI ROM)

    Stack Overflow | 6 months ago | Swarnveer Singh
    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>
  2. 0

    Android Studio Runtime Exception

    Stack Overflow | 1 year ago | Muhammad Mohsin Ajmal
    android.view.InflateException: Binary XML file line #12: Error inflating class android.widget.GridLayout

    Root Cause Analysis

    1. java.lang.OutOfMemoryError

      Failed to allocate a 20971884 byte allocation with 16777120 free bytes and 19MB until OOM

      at dalvik.system.VMRuntime.newNonMovableArray()
    2. Android Platform
      GridLayout.<init>
      1. dalvik.system.VMRuntime.newNonMovableArray(Native Method)
      2. android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
      3. android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:613)
      4. android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:446)
      5. android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:988)
      6. android.content.res.Resources.createFromResourceStream(Resources.java:2822)
      7. android.content.res.Resources.loadDrawableForCookie(Resources.java:2523)
      8. android.content.res.Resources.loadDrawable(Resources.java:2421)
      9. android.content.res.MiuiResources.loadDrawable(MiuiResources.java:393)
      10. android.content.res.TypedArray.getDrawable(TypedArray.java:751)
      11. android.view.View.<init>(View.java:3740)
      12. android.view.ViewGroup.<init>(ViewGroup.java:498)
      13. android.widget.GridLayout.<init>(GridLayout.java:285)
      14. android.widget.GridLayout.<init>(GridLayout.java:281)
      15. android.widget.GridLayout.<init>(GridLayout.java:277)
      15 frames
    3. Java RT
      Constructor.newInstance
      1. java.lang.reflect.Constructor.newInstance(Native Method)
      2. java.lang.reflect.Constructor.newInstance(Constructor.java:288)
      2 frames
    4. Android Platform
      LayoutInflater.createView
      1. android.view.LayoutInflater.createView(LayoutInflater.java:611)
      1 frame
    5. Android
      PhoneLayoutInflater.onCreateView
      1. com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
      1 frame
    6. Android Platform
      LayoutInflater.inflate
      1. android.view.LayoutInflater.onCreateView(LayoutInflater.java:686)
      2. android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:745)
      3. android.view.LayoutInflater.rInflate(LayoutInflater.java:810)
      4. android.view.LayoutInflater.inflate(LayoutInflater.java:508)
      5. android.view.LayoutInflater.inflate(LayoutInflater.java:418)
      6. android.view.LayoutInflater.inflate(LayoutInflater.java:365)
      6 frames
    7. Android v7
      AppCompatActivity.setContentView
      1. android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256)
      2. android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
      2 frames
    8. bt4u.com.pokemonbattles
      MainActivity.onCreate
      1. bt4u.com.pokemonbattles.MainActivity.onCreate(MainActivity.java:47)
      1 frame
    9. Android Platform
      ActivityThread.main
      1. android.app.Activity.performCreate(Activity.java:6041)
      2. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1109)
      3. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2285)
      4. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2394)
      5. android.app.ActivityThread.access$800(ActivityThread.java:154)
      6. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
      7. android.os.Handler.dispatchMessage(Handler.java:102)
      8. android.os.Looper.loop(Looper.java:135)
      9. android.app.ActivityThread.main(ActivityThread.java:5276)
      9 frames
    10. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:372)
      2 frames
    11. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)
      2 frames