When I build my application with "Use Shared Runtime" turned off and have the
following constructor for my IntentService

public ServerInitiatedSyncService()
            : base("ServerInitiatedSyncService")
        {
        }

The intent to my service fails with the following call stack:

11-15 10:54:37.455 E/AndroidRuntime(16760): java.lang.RuntimeException:
Unable to instantiate service
com.apexsi.apexware.ServerInitiatedSyncService:
java.lang.InstantiationException: can't instantiate class
com.apexsi.apexware.ServerInitiatedSyncService; no empty constructor
11-15 10:54:37.455 E/AndroidRuntime(16760): at
android.app.ActivityThread.handleCreateService(ActivityThread.java:2347)
11-15 10:54:37.455 E/AndroidRuntime(16760): at
android.app.ActivityThread.access$1600(ActivityThread.java:130)
11-15 10:54:37.455 E/AndroidRuntime(16760): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)
11-15 10:54:37.455 E/AndroidRuntime(16760): at
android.os.Handler.dispatchMessage(Handler.java:99)
11-15 10:54:37.455 E/AndroidRuntime(16760): at
android.os.Looper.loop(Looper.java:137)
11-15 10:54:37.455 E/AndroidRuntime(16760): at
android.app.ActivityThread.main(ActivityThread.java:4745)
11-15 10:54:37.455 E/AndroidRuntime(16760): at
java.lang.reflect.Method.invokeNative(Native Method)
11-15 10:54:37.455 E/AndroidRuntime(16760): at
java.lang.reflect.Method.invoke(Method.java:511)
11-15 10:54:37.455 E/AndroidRuntime(16760): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-15 10:54:37.455 E/AndroidRuntime(16760): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-15 10:54:37.455 E/AndroidRuntime(16760): at
dalvik.system.NativeStart.main(Native Method)
11-15 10:54:37.455 E/AndroidRuntime(16760): Caused by:
java.lang.InstantiationException: can't instantiate class
com.apexsi.apexware.ServerInitiatedSyncService; no empty constructor
11-15 10:54:37.455 E/AndroidRuntime(16760): at
java.lang.Class.newInstanceImpl(Native Method)
11-15 10:54:37.455 E/AndroidRuntime(16760): at
java.lang.Class.newInstance(Class.java:1319)
11-15 10:54:37.455 E/AndroidRuntime(16760): at
android.app.ActivityThread.handleCreateService(ActivityThread.java:2344)

If I have "Use Shared Runtime" on then it works.

Or if I use this for the constructor:

public ServerInitiatedSyncService()
            : base()
        {
        }

then it works

I believe this is a bug but can anyone help me with a work around.

Jonathan




--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/IntentService-Crashes-tp5712384.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to