title: Android - error opening trace file: No such file or directory
body: <p>I'm getting a weird list of errors, some seemingly disconnected but I have no way to tell as I can't even get my App to load to debug.  It's a very simple app, 3 radio buttons in a radio group and each one will trigger a different song to play.  </p>
  
  <p>I will start by posting my Manifest, my activity file, and layout then post the error log.</p>
  
  <p>Manifest:</p>
  
  <pre><code>    &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.cis298.lab2"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="17" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
  
          &lt;activity 
              android:label = "@string/app_name"
              android:name = ".LayoutActivity"&gt;
              &lt;intent-filter &gt;
                  &lt;action android:name = "android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name = "android.intent.category.LAUNCHER" /&gt;
  
              &lt;/intent-filter&gt;
              &gt;&lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>LayoutActivity:</p>
  
  <pre><code>package com.cis298.lab2;
  
  import java.io.IOException;
  
  import com.cis298.lab2.R;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.media.MediaPlayer;
  import android.widget.RadioGroup;
  
  public class LayoutActivity extends Activity {
  
      int song;
      MediaPlayer mediaplayer = MediaPlayer.create(this, song);
  
      public void onCreate(Bundle savedInstanceState){
          super.onCreate(savedInstanceState);
          setContentView(R.layout.layout);
          try {
              mediaplayer.prepare();
          } catch (IllegalStateException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
          RadioGroup radgrp = (RadioGroup) findViewById(R.id.radiogroup);
          radgrp.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
  
              @Override
              public void onCheckedChanged(RadioGroup group, int checkedId) {
                  switch (checkedId){
                  case R.id.dance:
                      song = R.raw.redalert;
                      mediaplayer.start();
                      break;
                  case R.id.rap:
                      song = R.raw.cannedheat;
                      break;
                  case R.id.rock:
                      song = R.raw.movmou8105;
                      break;}
              }
          });
      }
  }
  </code></pre>
  
  <p>layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
     &lt;RadioGroup
         android:id="@+id/radiogroup"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_alignParentLeft="true"
         android:layout_alignParentTop="true"
         android:orientation="vertical" &gt;
  
         &lt;RadioButton
             android:id="@+id/rock"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="Play Rock" /&gt;
  
         &lt;RadioButton
             android:id="@+id/rap"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="Play Rap" 
             android:checked="true"/&gt;
  
         &lt;RadioButton
             android:id="@+id/dance"
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:text="Play Dance"
             android:textAlignment="center" /&gt;
  
     &lt;/RadioGroup&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Log:</p>
  
  <blockquote>
    <p>02-21 20:34:05.044: D/AndroidRuntime(322): Shutting down VM 02-21
    20:34:05.044: W/dalvikvm(322): threadid=1: thread exiting with
    uncaught exception (group=0x4001d800) 02-21 20:34:05.094:
    E/AndroidRuntime(322): FATAL EXCEPTION: main 02-21 20:34:05.094:
    E/AndroidRuntime(322): java.lang.RuntimeException: Unable to
    instantiate activity
    ComponentInfo{com.cis298.lab2/com.cis298.lab2.LayoutActivity}:
    java.lang.NullPointerException 02-21 20:34:05.094:
    E/AndroidRuntime(322):    at
    android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
    02-21 20:34:05.094: E/AndroidRuntime(322):    at
    android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
    02-21 20:34:05.094: E/AndroidRuntime(322):    at
    android.app.ActivityThread.access$2300(ActivityThread.java:125) 02-21
    20:34:05.094: E/AndroidRuntime(322):  at
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
    02-21 20:34:05.094: E/AndroidRuntime(322):    at
    android.os.Handler.dispatchMessage(Handler.java:99) 02-21
    20:34:05.094: E/AndroidRuntime(322):  at
    android.os.Looper.loop(Looper.java:123) 02-21 20:34:05.094:
    E/AndroidRuntime(322):    at
    android.app.ActivityThread.main(ActivityThread.java:4627) 02-21
    20:34:05.094: E/AndroidRuntime(322):  at
    java.lang.reflect.Method.invokeNative(Native Method) 02-21
    20:34:05.094: E/AndroidRuntime(322):  at
    java.lang.reflect.Method.invoke(Method.java:521) 02-21 20:34:05.094:
    E/AndroidRuntime(322):    at
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
    02-21 20:34:05.094: E/AndroidRuntime(322):    at
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 02-21
    20:34:05.094: E/AndroidRuntime(322):  at
    dalvik.system.NativeStart.main(Native Method) 02-21 20:34:05.094:
    E/AndroidRuntime(322): Caused by: java.lang.NullPointerException 02-21
    20:34:05.094: E/AndroidRuntime(322):  at
    android.content.ContextWrapper.getResources(ContextWrapper.java:80)
    02-21 20:34:05.094: E/AndroidRuntime(322):    at
    android.media.MediaPlayer.create(MediaPlayer.java:641) 02-21
    20:34:05.094: E/AndroidRuntime(322):  at
    com.cis298.lab2.LayoutActivity.(LayoutActivity.java:15) 02-21
    20:34:05.094: E/AndroidRuntime(322):  at
    java.lang.Class.newInstanceImpl(Native Method) 02-21 20:34:05.094:
    E/AndroidRuntime(322):    at
    java.lang.Class.newInstance(Class.java:1429) 02-21 20:34:05.094:
    E/AndroidRuntime(322):    at
    android.app.Instrumentation.newActivity(Instrumentation.java:1021)
    02-21 20:34:05.094: E/AndroidRuntime(322):    at
    android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
    02-21 20:34:05.094: E/AndroidRuntime(322):    ... 11 more</p>
  </blockquote>
  
  <p>Any help would be greatly appreciated.</p>