java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gamerscave.codingclicker/com.gamerscave.codingclicker.Game}: android.view.InflateException: Binary XML file line #21: Binary XML file line #21: Error inflating class com.gamerscave.codingclicker.Clicker

Stack Overflow | Polarbear0106 | 8 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Creating ID for issues based on two parameters

    Stack Overflow | 8 months ago | Polarbear0106
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gamerscave.codingclicker/com.gamerscave.codingclicker.Game}: android.view.InflateException: Binary XML file line #21: Binary XML file line #21: Error inflating class com.gamerscave.codingclicker.Clicker

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference

      at com.gamerscave.codingclicker.Clicker.init()
    2. com.gamerscave.codingclicker
      Clicker.<init>
      1. com.gamerscave.codingclicker.Clicker.init(Clicker.java:241)
      2. com.gamerscave.codingclicker.Clicker.<init>(Clicker.java:217)
      2 frames
    3. Java RT
      Constructor.newInstance
      1. java.lang.reflect.Constructor.newInstance(Native Method)
      1 frame
    4. Android Platform
      LayoutInflater.inflate
      1. android.view.LayoutInflater.createView(LayoutInflater.java:631)
      2. android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
      3. android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716)
      4. android.view.LayoutInflater.rInflate(LayoutInflater.java:847)
      5. android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
      6. android.view.LayoutInflater.rInflate(LayoutInflater.java:855)
      7. android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
      8. android.view.LayoutInflater.inflate(LayoutInflater.java:527)
      9. android.view.LayoutInflater.inflate(LayoutInflater.java:429)
      10. android.view.LayoutInflater.inflate(LayoutInflater.java:380)
      10 frames
    5. Android
      PhoneWindow.setContentView
      1. com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:474)
      1 frame
    6. Android Platform
      Activity.setContentView
      1. android.app.Activity.setContentView(Activity.java:2387)
      1 frame
    7. com.gamerscave.codingclicker
      Game.onCreate
      1. com.gamerscave.codingclicker.Game.onCreate(Game.java:62)
      1 frame
    8. Android Platform
      ActivityThread.main
      1. android.app.Activity.performCreate(Activity.java:6876)
      2. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
      3. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3207)
      4. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
      5. android.app.ActivityThread.access$1100(ActivityThread.java:222)
      6. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
      7. android.os.Handler.dispatchMessage(Handler.java:102)
      8. android.os.Looper.loop(Looper.java:158)
      9. android.app.ActivityThread.main(ActivityThread.java:7229)
      9 frames
    9. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      1 frame
    10. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
      2 frames