Hi I've be looking all over the internet to find a solution to this
but I haven't seen one posted so here's my problem.

I have two Android projects in Eclipse 'HelloAndroid' and 'cam'. I
wanted to use one of the classes in cam. This Class 'RectangleDrawer'
also has an static nested class called RectangleDrawerCallback which I
also use.

The code in HelloAndroid is as follows:

import com.android.cam.RectangleDrawer;
import com.android.cam.RectangleDrawer.RectangleDrawerCallBack;

//more imports ...

public class HelloAndroid extends Activity implements
RectangleDrawerCallBack   {
    /** Called when the activity is first created. */
        private static final String TAG = "HelloAndroid";
    @Override
    public void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE); // remove program
title bar
                getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                                WindowManager.LayoutParams.FLAG_FULLSCREEN); 
//enable fullscreen
        super.onCreate(savedInstanceState);
RectangleDrawer test = new RectangleDrawer(this,16,800,480,this);
setContentView(test, new
LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));

}

        public void finishedDrawingRectangle(Rect drawnRectangle) {
                // TODO Auto-generated method stub
                Log.d(TAG,"I've drawn rectangle:" + 
drawnRectangle.toShortString());
        }

}

Eclipse then requested that I add the 'Cam' project to the 'Java Build
Path' so I did this. Okay no build errors so far... I did 'Project >
Clean...' just in case something wasn't update properly.

So then I tried to run the application on my phone (google nexus one)
and the application crashes. The error log is as follows:

D/AndroidRuntime( 2956):
D/AndroidRuntime( 2956): >>>>>>>>>>>>>> AndroidRuntime START
<<<<<<<<<<<<<<
D/AndroidRuntime( 2956): CheckJNI is OFF
D/dalvikvm( 2956): Precise GC configured ON
D/dalvikvm( 2956): creating instr width table
D/AndroidRuntime( 2956): --- registering native functions ---
D/ddm-heap( 2956): Got feature list request
D/AndroidRuntime( 2956): Shutting down VM
D/dalvikvm( 2956): DestroyJavaVM waiting for non-daemon threads to
exit
D/dalvikvm( 2956): DestroyJavaVM shutting VM down
D/dalvikvm( 2956): HeapWorker thread shutting down
D/dalvikvm( 2956): HeapWorker thread has shut down
D/jdwp    ( 2956): JDWP shutting down net...
I/dalvikvm( 2956): Debugger has detached; object registry had 1
entries
D/dalvikvm( 2956): VM cleaning up
E/AndroidRuntime( 2956): ERROR: thread attach failed
D/dalvikvm( 2956): LinearAlloc 0x0 used 629532 of 5242880 (12%)
D/AndroidRuntime( 2963):
D/AndroidRuntime( 2963): >>>>>>>>>>>>>> AndroidRuntime START
<<<<<<<<<<<<<<
D/AndroidRuntime( 2963): CheckJNI is OFF
D/dalvikvm( 2963): Precise GC configured ON
D/dalvikvm( 2963): creating instr width table
D/AndroidRuntime( 2963): --- registering native functions ---
D/ddm-heap( 2963): Got feature list request
D/AndroidRuntime( 2963): Shutting down VM
D/dalvikvm( 2963): DestroyJavaVM waiting for non-daemon threads to
exit
D/dalvikvm( 2963): DestroyJavaVM shutting VM down
D/dalvikvm( 2963): HeapWorker thread shutting down
D/dalvikvm( 2963): HeapWorker thread has shut down
D/jdwp    ( 2963): JDWP shutting down net...
I/dalvikvm( 2963): Debugger has detached; object registry had 1
entries
D/dalvikvm( 2963): VM cleaning up
E/AndroidRuntime( 2963): ERROR: thread attach failed
D/dalvikvm( 2963): LinearAlloc 0x0 used 629532 of 5242880 (12%)
D/AndroidRuntime( 2970):
D/AndroidRuntime( 2970): >>>>>>>>>>>>>> AndroidRuntime START
<<<<<<<<<<<<<<
D/AndroidRuntime( 2970): CheckJNI is OFF
D/dalvikvm( 2970): Precise GC configured ON
D/dalvikvm( 2970): creating instr width table
D/AndroidRuntime( 2970): --- registering native functions ---
D/ddm-heap( 2970): Got feature list request
I/ActivityManager(   80): Starting activity: Intent
{ act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x10000000
cmp=com.example.helloandroid/.HelloAndroid }
D/AndroidRuntime( 2970): Shutting down VM
D/dalvikvm( 2970): DestroyJavaVM waiting for non-daemon threads to
exit
D/dalvikvm( 2970): DestroyJavaVM shutting VM down
D/dalvikvm( 2970): HeapWorker thread shutting down
D/dalvikvm( 2970): HeapWorker thread has shut down
D/jdwp    ( 2970): JDWP shutting down net...
I/dalvikvm( 2970): Debugger has detached; object registry had 1
entries
D/dalvikvm( 2970): VM cleaning up
E/AndroidRuntime( 2970): ERROR: thread attach failed
I/ActivityManager(   80): Start proc com.example.helloandroid for
activity com.example.helloandroid/.HelloAndroid: pid=2976 uid=10059
gids={}
D/dalvikvm( 2970): LinearAlloc 0x0 used 639500 of 5242880 (12%)
I/WindowManager(   80): Setting rotation to 1, animFlags=0
I/ActivityManager(   80): Config changed: { scale=1.0 imsi=440/20
loc=en_GB touch=3 keys=1/1/2 nav=3/1 orien=2 layout=34}
V/RenderScript_jni(  148): surfaceChanged
V/RenderScript(  148): setSurface 800 442 0x124898
D/ddm-heap( 2976): Got feature list request
I/dalvikvm( 2976): Failed resolving Lcom/example/helloandroid/
HelloAndroid; interface 9 'Lcom/android/cam/RectangleDrawer
$RectangleDrawerCallBack;'
W/dalvikvm( 2976): Link of class 'Lcom/example/helloandroid/
HelloAndroid;' failed
D/AndroidRuntime( 2976): Shutting down VM
W/dalvikvm( 2976): threadid=3: thread exiting with uncaught exception
(group=0x4001b180)
E/AndroidRuntime( 2976): Uncaught handler: thread main exiting due to
uncaught exception
E/AndroidRuntime( 2976): java.lang.RuntimeException: Unable to
instantiate activity ComponentInfo{com.example.helloandroid/
com.example.helloandroid.HelloAndroid}:
java.lang.ClassNotFoundException:
com.example.helloandroid.HelloAndroid in loader
dalvik.system.pathclassloa...@44948c38
E/AndroidRuntime( 2976):        at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2417)
E/AndroidRuntime( 2976):        at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2512)
E/AndroidRuntime( 2976):        at android.app.ActivityThread.access
$2200(ActivityThread.java:119)
E/AndroidRuntime( 2976):        at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:1863)
E/AndroidRuntime( 2976):        at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2976):        at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2976):        at
android.app.ActivityThread.main(ActivityThread.java:4363)
E/AndroidRuntime( 2976):        at
java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2976):        at
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 2976):        at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 2976):        at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime( 2976):        at dalvik.system.NativeStart.main(Native
Method)
E/AndroidRuntime( 2976): Caused by: java.lang.ClassNotFoundException:
com.example.helloandroid.HelloAndroid in loader
dalvik.system.pathclassloa...@44948c38
E/AndroidRuntime( 2976):        at
dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
E/AndroidRuntime( 2976):        at
java.lang.ClassLoader.loadClass(ClassLoader.java:573)
E/AndroidRuntime( 2976):        at
java.lang.ClassLoader.loadClass(ClassLoader.java:532)
E/AndroidRuntime( 2976):        at
android.app.Instrumentation.newActivity(Instrumentation.java:1021)
E/AndroidRuntime( 2976):        at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2409)
E/AndroidRuntime( 2976):        ... 11 more
I/Process (   80): Sending signal. PID: 2976 SIG: 3
I/dalvikvm( 2976): threadid=7: reacting to signal 3
I/dalvikvm( 2976): Wrote stack trace to '/data/anr/traces.txt'
V/RenderScript(  140): setSurface 800 480 0x11d3a0
V/RenderScript_jni(  148): surfaceDestroyed
V/RenderScript(  148): setSurface 0 0 0x0
D/dalvikvm(   80): GC freed 1853 objects / 91384 bytes in 95ms
W/ActivityManager(   80): Launch timeout has expired, giving up wake
lock!
W/ActivityManager(   80): Activity idle timeout for
HistoryRecord{448aa118 com.example.helloandroid/.HelloAndroid}
D/dalvikvm(  148): GC freed 353 objects / 16600 bytes in 94ms

All I can tell from this error is that
'java.lang.ClassNotFoundException' means that the RectangleDrawer
class isn't acessible...

What's going on here?

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to