title: Android - java.lang.reflect.InvocationTargetException crash in my app
body: <p>I'm new to this programming world. I made a small app (Size of apk file is 1.74MB) for the first time and launched it to google play few months ago. I tested my app(before launching to the play store) with all the OS versions using the android studio emulators and it worked well with all those versions. Now I have received 26 crash reports from 7 users and I have no idea about what has gone wrong. I checked each line in my app individually according to the stack traces which are given in the crash reports and realized that those lines were created by the app itself. I searched all over the internet during the past week to find a solution for this issue.</p>
  
  <p><strong><em>98 people have installed this app and I have received crash reports only from 7 of them. Is it possible to occur this kind of a crash due to bad memory management(less free space, too many installed apps etc.) of those 7 devices?</em></strong></p>
  
  <p>Here's a screenshot from my play console.
  <a href="https://i.stack.imgur.com/D8QNy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D8QNy.png" alt="console"></a>  </p>
  
  <hr>
  
  <p>Here are the stack traces from those 7 devices. I have personally used this app in a Samsung Galaxy J7 prime and it worked well with it. <strong>But here there's a crash report from same type of a device too.</strong></p>
  
  <pre><code>Oct 20, 1:10 PM on app version 2
  Samsung Galaxy J7 Prime (on7xelte), 3072MB RAM, Android 6.0
  Report 6 of 6
  
  java.lang.IllegalStateException: 
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick (AppCompatViewInflater.java:293)
    at android.view.View.performClick (View.java:5721)
    at android.widget.TextView.performClick (TextView.java:10931)
    at android.view.View$PerformClick.run (View.java:22620)
    at android.os.Handler.handleCallback (Handler.java:739)
    at android.os.Handler.dispatchMessage (Handler.java:95)
    at android.os.Looper.loop (Looper.java:148)
    at android.app.ActivityThread.main (ActivityThread.java:7409)
    at java.lang.reflect.Method.invoke (Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)
  Caused by: java.lang.reflect.InvocationTargetException: 
    at java.lang.reflect.Method.invoke (Native Method)
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick (AppCompatViewInflater.java:288)
  </code></pre>
  
  <hr>
  
  <pre><code>Nov 3, 12:45 PM on app version 2
  Huawei Y3II (HWLUA-L6735), 1024MB RAM, Android 5.1
  Report 1 of 2
  
  java.lang.IllegalStateException: 
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick (AppCompatViewInflater.java:293)
    at android.view.View.performClick (View.java:4848)
    at android.view.View$PerformClick.run (View.java:20270)
    at android.os.Handler.handleCallback (Handler.java:815)
    at android.os.Handler.dispatchMessage (Handler.java:104)
    at android.os.Looper.loop (Looper.java:194)
    at android.app.ActivityThread.main (ActivityThread.java:5674)
    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:963)
    at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:758)
  Caused by: java.lang.reflect.InvocationTargetException: 
    at java.lang.reflect.Method.invoke (Native Method)
    at java.lang.reflect.Method.invoke (Method.java:372)
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick (AppCompatViewInflater.java:288)
  </code></pre>
  
  <hr>
  
  <pre><code>Oct 25, 9:52 AM on app version 2
  Samsung Galaxy Note3 (hltektt), 3072MB RAM, Android 5.0
  Report 2 of 2
  
  java.lang.IllegalStateException: 
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick (AppCompatViewInflater.java:293)
    at android.view.View.performClick (View.java:5194)
    at android.view.View$PerformClick.run (View.java:20903)
    at android.os.Handler.handleCallback (Handler.java:739)
    at android.os.Handler.dispatchMessage (Handler.java:95)
    at android.os.Looper.loop (Looper.java:145)
    at android.app.ActivityThread.main (ActivityThread.java:5942)
    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:1399)
    at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1194)
  Caused by: java.lang.reflect.InvocationTargetException: 
    at java.lang.reflect.Method.invoke (Native Method)
    at java.lang.reflect.Method.invoke (Method.java:372)
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick (AppCompatViewInflater.java:288)
  </code></pre>
  
  <hr>
  
  <pre><code>Nov 11, 3:16 PM on app version 2
  Oppo CPH1701 (CPH1701), 3072MB RAM, Android 6.0
  Report 1
  
  java.lang.IllegalStateException: 
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick (AppCompatViewInflater.java:293)
    at android.view.View.performClick (View.java:5231)
    at android.view.View$PerformClick.run (View.java:21240)
    at android.os.Handler.handleCallback (Handler.java:739)
    at android.os.Handler.dispatchMessage (Handler.java:95)
    at android.os.Looper.loop (Looper.java:179)
    at android.app.ActivityThread.main (ActivityThread.java:5730)
    at java.lang.reflect.Method.invoke (Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:791)
    at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:681)
  Caused by: java.lang.reflect.InvocationTargetException: 
    at java.lang.reflect.Method.invoke (Native Method)
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick (AppCompatViewInflater.java:288)
  </code></pre>
  
  <hr>
  
  <pre><code>Oct 30, 10:47 PM on app version 2
  OnePlus OnePlus3T (OnePlus3T), 6144MB RAM, Android 7.1
  Report 15
  
  java.lang.IllegalStateException: 
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick (AppCompatViewInflater.java:293)
    at android.view.View.performClick (View.java:5669)
    at android.view.View$PerformClick.run (View.java:22549)
    at android.os.Handler.handleCallback (Handler.java:751)
    at android.os.Handler.dispatchMessage (Handler.java:95)
    at android.os.Looper.loop (Looper.java:154)
    at android.app.ActivityThread.main (ActivityThread.java:6321)
    at java.lang.reflect.Method.invoke (Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:776)
  Caused by: java.lang.reflect.InvocationTargetException: 
    at java.lang.reflect.Method.invoke (Native Method)
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick (AppCompatViewInflater.java:288)
  </code></pre>
  
  <hr>
  
  <pre><code>Oct 20, 4:46 PM on app version 2
  HTC One A9 (htc_hiaeuhl), 2048MB RAM, Android 7.0
  Report 17 of 18
  
  java.lang.IllegalStateException: 
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick (AppCompatViewInflater.java:293)
    at android.view.View.performClick (View.java:5637)
    at android.view.View$PerformClick.run (View.java:22396)
    at android.os.Handler.handleCallback (Handler.java:751)
    at android.os.Handler.dispatchMessage (Handler.java:95)
    at android.os.Looper.loop (Looper.java:173)
    at android.app.ActivityThread.main (ActivityThread.java:6459)
    at java.lang.reflect.Method.invoke (Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:938)
    at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:828)
  Caused by: java.lang.reflect.InvocationTargetException: 
    at java.lang.reflect.Method.invoke (Native Method)
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick (AppCompatViewInflater.java:288)
  </code></pre>
  
  <hr>
  
  <pre><code>Nov 4, 1:58 PM on app version 2
  Samsung Galaxy J2(2016) (j2xlte), 1536MB RAM, Android 6.0
  Report 1
  
  java.lang.IllegalStateException: 
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick (AppCompatViewInflater.java:293)
    at android.view.View.performClick (View.java:5716)
    at android.widget.TextView.performClick (TextView.java:10926)
    at android.view.View$PerformClick.run (View.java:22596)
    at android.os.Handler.handleCallback (Handler.java:739)
    at android.os.Handler.dispatchMessage (Handler.java:95)
    at android.os.Looper.loop (Looper.java:148)
    at android.app.ActivityThread.main (ActivityThread.java:7325)
    at java.lang.reflect.Method.invoke (Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)
  Caused by: java.lang.reflect.InvocationTargetException: 
    at java.lang.reflect.Method.invoke (Native Method)
    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick (AppCompatViewInflater.java:288)
  </code></pre>
  
  <hr>