[Android Q&A, Help & Troubleshooting] bizkit1:
Hello guys. So i'm trying to make a app that will play a aac stream from an online radio station. I managed to build the project but i get this error when running it.

05-27 06:12:00.734: E/AndroidRuntime(450): FATAL EXCEPTION: main
05-27 06:12:00.734: E/AndroidRuntime(450): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.spoledge.aacplay/com.spoledge.aacplay.AACPlayerActivity}: java.lang.ClassNotFoundException: com.spoledge.aacplay.AACPlayerActivity in loader dalvik.system.PathClassLoader[/data/app/com.spoledge.aacplay-2.apk]
05-27 06:12:00.734: E/AndroidRuntime(450):	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
05-27 06:12:00.734: E/AndroidRuntime(450):	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
05-27 06:12:00.734: E/AndroidRuntime(450):	at android.app.ActivityThread.access$1500(ActivityThread.java:117)
05-27 06:12:00.734: E/AndroidRuntime(450):	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
05-27 06:12:00.734: E/AndroidRuntime(450):	at android.os.Handler.dispatchMessage(Handler.java:99)
05-27 06:12:00.734: E/AndroidRuntime(450):	at android.os.Looper.loop(Looper.java:123)
05-27 06:12:00.734: E/AndroidRuntime(450):	at android.app.ActivityThread.main(ActivityThread.java:3683)
05-27 06:12:00.734: E/AndroidRuntime(450):	at java.lang.reflect.Method.invokeNative(Native Method)
05-27 06:12:00.734: E/AndroidRuntime(450):	at java.lang.reflect.Method.invoke(Method.java:507)
05-27 06:12:00.734: E/AndroidRuntime(450):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-27 06:12:00.734: E/AndroidRuntime(450):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-27 06:12:00.734: E/AndroidRuntime(450):	at dalvik.system.NativeStart.main(Native Method)
05-27 06:12:00.734: E/AndroidRuntime(450): Caused by: java.lang.ClassNotFoundException: com.spoledge.aacplay.AACPlayerActivity in loader dalvik.system.PathClassLoader[/data/app/com.spoledge.aacplay-2.apk]
05-27 06:12:00.734: E/AndroidRuntime(450):	at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
05-27 06:12:00.734: E/AndroidRuntime(450):	at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
05-27 06:12:00.734: E/AndroidRuntime(450):	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
05-27 06:12:00.734: E/AndroidRuntime(450):	at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-27 06:12:00.734: E/AndroidRuntime(450):	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
05-27 06:12:00.734: E/AndroidRuntime(450):	... 11 more

This is my project AACPlayerActivity.java code:

package com.spoledge.aacplay;

import android.app.Activity;
import android.app.AlertDialog;

import android.content.DialogInterface;
import android.content.Intent;

import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;

import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.spoledge.aacdecoder.AACPlayer;
import com.spoledge.aacdecoder.PlayerCallback;

/**
* This is the main activity.
*/
public class AACPlayerActivity extends Activity implements View.OnClickListener, PlayerCallback {

private History history;
private AutoCompleteTextView urlView;
private Button btnPlay;
private Button btnStop;
private TextView txtStatus;
private EditText txtBufAudio;
private EditText txtBufDecode;
private ProgressBar progress;
private Handler uiHandler;

private AACPlayer aacPlayer;

////////////////////////////////////////////////////////////////////////////
// PlayerCallback
////////////////////////////////////////////////////////////////////////////

private boolean playerStarted;

public void playerStarted() {
uiHandler.post( new Runnable() {
public void run() {
txtBufAudio.setEnabled( false );
txtBufDecode.setEnabled( false );
btnPlay.setEnabled( false );
btnStop.setEnabled( true );

txtStatus.setText( R.string.text_buffering );
progress.setProgress( 0 );
progress.setVisibility( View.VISIBLE );

playerStarted = true;
}
});
}

/**
* This method is called periodically by PCMFeed.
*
* @param isPlaying false means that the PCM data are being buffered,
* but the audio is not playing yet
*
* @param audioBufferSizeMs the buffered audio data expressed in milliseconds of playing
* @param audioBufferCapacityMs the total capacity of audio buffer expressed in milliseconds of playing
*/
public void playerPCMFeedBuffer( final boolean isPlaying,
final int audioBufferSizeMs, final int audioBufferCapacityMs ) {

uiHandler.post( new Runnable() {
public void run() {
progress.setProgress( audioBufferSizeMs * progress.getMax() / audioBufferCapacityMs );
if (isPlaying) txtStatus.setText( R.string.text_playing );
}
});
}

public void playerStopped( final int perf ) {
uiHandler.post( new Runnable() {
public void run() {
btnPlay.setEnabled( true );
btnStop.setEnabled( false );
txtBufAudio.setEnabled( true );
txtBufDecode.setEnabled( true );
// txtStatus.setText( R.string.text_stopped );
txtStatus.setText( "" + perf + " %" );
progress.setVisibility( View.INVISIBLE );

playerStarted = false;
}
});
}

public void playerException( final Throwable t) {
uiHandler.post( new Runnable() {
public void run() {
new AlertDialog.Builder( AACPlayerActivity.this )
.setTitle( R.string.text_exception )
.setMessage( t.toString())
.setNeutralButton( R.string.button_close,
new DialogInterface.OnClickListener() {
public void onClick( DialogInterface dialog, int id) {
dialog.cancel();
}
}
)
.show();

txtStatus.setText( R.string.text_stopped );

if (playerStarted) playerStopped( 0 );
}
});
}

////////////////////////////////////////////////////////////////////////////
// OnClickListener
////////////////////////////////////////////////////////////////////////////

/**
* Called when a view has been clicked.
*/
public void onClick( View v ) {
try {
switch (v.getId()) {
case R.id.view_main_button_play: start(); break;
case R.id.view_main_button_stop: stop(); break;
}
}
catch (Exception e) {
Log.e( "AACPlayerActivity", "exc" , e );
}
}

////////////////////////////////////////////////////////////////////////////
// Protected
////////////////////////////////////////////////////////////////////////////

@Override
protected void onCreate( Bundle savedInstanceState ) {
super.onCreate( savedInstanceState );

setContentView( R.layout.main );

btnPlay = (Button) findViewById( R.id.view_main_button_play );
btnStop = (Button) findViewById( R.id.view_main_button_stop );

urlView = (AutoCompleteTextView) findViewById( R.id.view_main_edit_url );
txtStatus = (TextView) findViewById( R.id.view_main_text_status );
txtBufAudio = (EditText) findViewById( R.id.view_main_text_bufaudio );
txtBufDecode = (EditText) findViewById( R.id.view_main_text_bufdecode );

progress = (ProgressBar) findViewById( R.id.view_main_progress );

txtBufAudio.setText( String.valueOf( AACPlayer.DEFAULT_AUDIO_BUFFER_CAPACITY_MS ));
txtBufDecode.setText( String.valueOf( AACPlayer.DEFAULT_DECODE_BUFFER_CAPACITY_MS ));

btnPlay.setOnClickListener( this );
btnStop.setOnClickListener( this );

history = new History( this );
history.read();

if (history.size() == 0 ) {
history.addUrl( "/sdcard/local/cro2-32.aac" );
history.addUrl( "netshow.play.cz:8000/crocb32aac" );
history.addUrl( "62.44.1.26:8000/cro2-128aac" );
history.addUrl( "2483.live.streamtheworld.com:80/KFTZFMAACCMP3" );
history.addUrl( "yourmuze.com:8000/play/paradise/l.aac" );
history.addUrl( "yourmuze.com:8000/play/paradise/m.aac" );
history.addUrl( "yourmuze.com:8000/play/paradise/h.aac" );
}

urlView.setAdapter( history.getArrayAdapter());
uiHandler = new Handler();
}

@Override
protected void onPause() {
super.onPause();
history.write();
}

@Override
protected void onDestroy() {
super.onDestroy();
stop();
}

////////////////////////////////////////////////////////////////////////////
// Private
////////////////////////////////////////////////////////////////////////////

private void start() {
stop();
aacPlayer = new AACPlayer( this, getInt( txtBufAudio ), getInt( txtBufDecode ));
aacPlayer.playAsync( getUrl());
}

private void stop() {
if (aacPlayer != null) {
aacPlayer.stop();
aacPlayer = null;
}
}

private String getUrl() {
String ret = urlView.getText().toString();

history.addUrl( ret );

return ret;
}

private int getInt( EditText et ) {
return Integer.parseInt( et.getText().toString());
}

}

And this is my AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="schemas.android.com/apk/res/android"
package="com.spoledge.aacplay"
android:versionCode="1"
android:versionName="@string/app_version"
>

<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk android:minSdkVersion="10"/>

<application
android:label="@string/app_name"
android:debuggable="true"
>

<activity
android:name="com.spoledge.aacplay.AACPlayerActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
>

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

</activity>
</application>
</manifest>

So can someone help me solve this out? Thanks!