Then I reboot. Now, every time it tries to use the authentication mechanism, it force closes. On the phone, it doesn't give any details at all in logCat. On the emulator, I can't replicate it.
Or can I? I go into Manage Applications and force close the app. Launch it and voila, same thing.
Specifically, Account Manager's blockingGetAuthToken is trying to load the authentication class (which it used not more than 30 seconds ago) and I get this:
(slightly cleaned up stack)
W/dalvikvm( 550): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
E/AndroidRuntime( 550): FATAL EXCEPTION: main
E/AndroidRuntime( 550): java.lang.RuntimeException: Unable to instantiate service org.eoti.MyAuthenticationService: java.lang.ClassNotFoundException: org.eoti.MyAuthenticationService in loader dalvik.system.PathClassLoader[/data/app/org.eoti.test-1.apk]
E/AndroidRuntime( 550): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2943)
E/AndroidRuntime( 550): at android.app.ActivityThread.access$3300(ActivityThread.java:125)
E/AndroidRuntime( 550): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
E/AndroidRuntime( 550): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 550): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 550): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime( 550): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 550): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 550): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 550): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime( 550): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 550): Caused by: java.lang.ClassNotFoundException: org.eoti.MyAuthenticationService in loader dalvik.system.PathClassLoader[/data/app/org.eoti.test-1.apk]
E/AndroidRuntime( 550): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
E/AndroidRuntime( 550): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
E/AndroidRuntime( 550): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
E/AndroidRuntime( 550): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2940)
E/AndroidRuntime( 550): ... 10 more
I/Process ( 550): Sending signal. PID: 550 SIG: 9
I/ActivityManager( 59): Process org.eoti.test:main (pid 550) has died.
Ok... so it is able to load the classes... until a reboot (or force close)... and then it can't find them anymore? If anyone has any thoughts on the matter, I'd be keen to hear them...