title: Why is my Android app force-closing from a java.lang.ExceptionInInitializerError, and it's not being caught by the try/catch block?
body: <p>I'm using reflection to see if the Equalizer class is available for Android OS 2.3 and higher, and then use that class if it is available. However, I'm periodically getting crash reports with the "ExceptionInInitializerError". Here are the stacktrace:</p>
  
  <pre><code>java.lang.ExceptionInInitializerError
  at java.lang.Class.classForName(Native Method)
  at java.lang.Class.forName(Class.java:234)
  at java.lang.Class.forName(Class.java:181)
  at com.myapp.EQ.&lt;init&gt;(SourceFile:16)
  at com.myapp.mainAct.onCreate(SourceFile:209)
  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:130)
  at android.app.ActivityThread.main(ActivityThread.java:3687)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:507)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
  at dalvik.system.NativeStart.main(Native Method)
  Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1312]: 277 cannot locate '_ZN7android11AudioEffect25queryDefaultPreProcessingEiP19effect_descriptor_sPj'...
  
  at java.lang.Runtime.loadLibrary(Runtime.java:455)
  at java.lang.System.loadLibrary(System.java:554)
  at android.media.audiofx.AudioEffect.&lt;clinit&gt;(AudioEffect.java:63)
  </code></pre>
  
  <p>And here's the custom class where the error is getting thrown:</p>
  
  <pre><code>public class EQ{
      private Class&lt;?&gt; eqClass = null;
  
      public EQ(){
          if(Build.VERSION.SDK_INT &gt;= 9){
              try {
                  eqClass = Class.forName("android.media.audiofx.Equalizer"); 
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }
  }
  </code></pre>
  
  <p>So, the crash happens at the "Class.forName" line, and any exception should be caught by the <code>Catch</code> block. Why isn't it?</p>
  
  <p>This happens sporadically, and I've received 5 different crash reports over the last 2 months. </p>