lavirott
lavirott

Reputation: 1

System.TypeLoadException new with MonoAndroid 4.0

I've got a System.TypeLoadException with MonoAndroid 4.0. With exactly the same source code, I didn't have any problem with MonoAndroid 1.9-beta 2 and before.

I/AndroidWComp(  911): OnCreate()
I/AndroidWComp(  911): Start container...
F/AndroidWComp(  911): android.util.Log$TerribleFailure: System.TypeLoadException: A type load exception has occurred.
F/AndroidWComp(  911):   at WComp.Container.Container.Start () [0x00046] in D:\Dev\src\WComp\SharpWcomp3\src\Container\ContainerMonoAndroid\ContainerMonoAndroid.cs:148
F/AndroidWComp(  911):  at android.util.Log.wtf(Log.java:260)
F/AndroidWComp(  911):  at android.util.Log.wtf(Log.java:239)
F/AndroidWComp(  911):  at wcomp.container.Container.n_onCreate(Native Method)
F/AndroidWComp(  911):  at wcomp.container.Container.onCreate(Container.java:29)

F/AndroidWComp(  911):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
F/AndroidWComp(  911):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
F/AndroidWComp(  911):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
F/AndroidWComp(  911):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
F/AndroidWComp(  911):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
F/AndroidWComp(  911):  at android.os.Handler.dispatchMessage(Handler.java:99)
F/AndroidWComp(  911):  at android.os.Looper.loop(Looper.java:123)
F/AndroidWComp(  911):  at android.app.ActivityThread.main(ActivityThread.java:4627)
F/AndroidWComp(  911):  at java.lang.reflect.Method.invokeNative(Native Method)
F/AndroidWComp(  911):  at java.lang.reflect.Method.invoke(Method.java:521)
F/AndroidWComp(  911):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
F/AndroidWComp(  911):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
F/AndroidWComp(  911):  at dalvik.system.NativeStart.main(Native Method)

This error occurs at a really early stage of initialization of the application. It occurs on the following lines (Start function is called in the main OnCreate function):

    private void Start()
    {
        Logger.Info("Start container...");
        container = new Container();
        designer = new DesignerInterface(container.appli);
        designer.AppliEventInDesigner += new AppliUpdate(designer_AppliEventInDesigner);
        device = new WCompNetDevice(containerName, designer);

The error occurs on the last line (designer is well defined and containerName also. And if I add a break point in the WCompNetDevice, I never reach it.

I'm completly disappointed because I try to find out the problem myself, reading the stackoverflow questions/answers, but without any sucess. I tried to have information from fuslogvw, checked that all my assemblies were for the same android framework, clean and rebuild all the solution, restarting VS2010, ...

And exactly the same code was ok with previous release of MonoAndroid (until 1.9-veta2 I tested). But since MonoAndroid 4.0, I've got this problem.

Is there anybody who can give me some help ?

Best regards,

Stéphane

Upvotes: 0

Views: 475

Answers (1)

jpobst
jpobst

Reputation: 9982

It doesn't look like the typical FastDev issue, but it's worth a shot to try.

Go to your project properties, uncheck "Fast Deployment", rebuild, redeploy, and try again.

Upvotes: 2

Related Questions