title: android application crashing with error java.lang.RuntimeException: Unable to instantiate activity ComponentInfo
body: <p>I am developing an android application. When i am trying to run it on emulator it crashes. It is my first android application and I am not able to find out the cause of error. Can anybody point out the mistake?</p>
  
  <p>LogCat</p>
  
  <pre><code>    Shutting down VM
  FATAL EXCEPTION: main
   Process: io.github.ishankgulati.breakout, PID: 3589
   java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{io.github.ishankgulati.breakout/io.github.ishankgulati.breakout.BreakoutGame}: java.lang.IllegalAccessException: void io.github.ishankgulati.breakout.BreakoutGame.&lt;init&gt;() is not accessible from java.lang.Class&lt;android.app.Instrumentation&gt;
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
       at android.app.ActivityThread.-wrap11(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:5417)
       at java.lang.reflect.Method.invoke(Native Method)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    Caused by: java.lang.IllegalAccessException: void io.github.ishankgulati.breakout.BreakoutGame.&lt;init&gt;() is not accessible from java.lang.Class&lt;android.app.Instrumentation&gt;
       at java.lang.Class.newInstance(Native Method)
       at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
       at android.app.ActivityThread.-wrap11(ActivityThread.java) 
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
       at android.os.Handler.dispatchMessage(Handler.java:102) 
       at android.os.Looper.loop(Looper.java:148) 
       at android.app.ActivityThread.main(ActivityThread.java:5417) 
       at java.lang.reflect.Method.invoke(Native Method) 
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
  12-29 19:10:34.689 3589-3589/? I/Process: Sending signal. PID: 3589 SIG: 9
  </code></pre>
  
  <p>You can have a look at my project <a href="https://github.com/IshankGulati/Breakout/tree/master/Breakout" rel="nofollow">here</a>.</p>
  
  <p>The above issue has been resolved but still application is crashing.</p>
  
  <p>LogCat</p>
  
  <pre><code>I/art: Not late-enabling -Xcheck:jni (already on)
  I/art: Late-enabling JIT
  I/art: JIT created with code_cache_capacity=2MB compile_threshold=1000
  W/System: ClassLoader referenced unknown path: /data/app/io.github.ishankgulati.breakout-1/lib/x86
  E/WVMExtractor: Failed to open libwvm.so: dlopen failed: library "libwvm.so" not found
  I/OMXClient: Using client-side OMX mux.
  D/MediaPlayer: setSubtitleAnchor in MediaPlayer
  W/art: Suspending all threads took: 33.410ms
  I/OMXClient: Using client-side OMX mux.
  D/AndroidRuntime: Shutting down VM
  E/AndroidRuntime: FATAL EXCEPTION: main
  Process: io.github.ishankgulati.breakout, PID: 2303
  java.lang.RuntimeException: Unable to start activity ComponentInfo{io.github.ishankgulati.breakout/io.github.ishankgulati.breakout.BreakoutGame}: java.lang.NullPointerException: Attempt to write to field 'float android.graphics.RectF.left' on a null object reference
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
     at android.app.ActivityThread.-wrap11(ActivityThread.java)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:148)
     at android.app.ActivityThread.main(ActivityThread.java:5417)
     at java.lang.reflect.Method.invoke(Native Method)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  Caused by: java.lang.NullPointerException: Attempt to write to field 'float android.graphics.RectF.left' on a null object reference
     at io.github.ishankgulati.breakout.MainMenu.&lt;init&gt;(MainMenu.java:33)
     at io.github.ishankgulati.breakout.BreakoutGame$BreakoutView.&lt;init&gt;(BreakoutGame.java:84)
     at io.github.ishankgulati.breakout.BreakoutGame$BreakoutView.&lt;init&gt;(BreakoutGame.java:51)
     at io.github.ishankgulati.breakout.BreakoutGame.onCreate(BreakoutGame.java:29)
     at android.app.Activity.performCreate(Activity.java:6237)
     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
     at android.os.Handler.dispatchMessage(Handler.java:102) 
     at android.os.Looper.loop(Looper.java:148) 
     at android.app.ActivityThread.main(ActivityThread.java:5417) 
     at java.lang.reflect.Method.invoke(Native Method) 
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
  </code></pre>