2012年11月27日 星期二

ikvm error

Error System.MissingMethodException: Method not found: 'Void System.Reflection.Emit.DynamicMethod
Background
‧ ikvmc ddmlib.jar (D:\android-sdk_r04-windows\android-sdk-windows\tools\lib\ddmlib.jar). This will output a ddmlib.dll file in current directory.
‧ Start the project and reference file ddmlib.dll.
‧ I used the following code in the entry function.

 
AndroidDebugBridge bridge = AndroidDebugBridge.createBridge();
waitDeviceList(bridge);
IDevice []devices = bridge.getDevices();


‧ Build the project.
‧ Run the executable file then it will show the error message box.


See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.TypeInitializationException: The type initializer for 'com.android.ddmlib.AndroidDebugBridge' threw an exception. ---> System.TypeInitializationException: The type initializer for 'java.net.InetAddress' threw an exception. ---> System.MissingMethodException: Method not found: 'Void System.Reflection.Emit.DynamicMethod..ctor(System.String, System.Type, System.Type[], Boolean)'.
   at DynamicMethodUtils.Create(String name, Type owner, Boolean nonPublic, Type returnType, Type[] paramTypes)
   at IKVM.NativeCode.sun.reflect.ReflectionFactory.FastConstructorAccessorImpl..ctor(Constructor constructor)
   at IKVM.NativeCode.sun.reflect.ReflectionFactory.newConstructorAccessor0(Object thisFactory, Object constructor)
   at sun.reflect.ReflectionFactory.newConstructorAccessor0(Constructor )
   at sun.reflect.ReflectionFactory.newConstructorAccessor(Constructor c)
   at java.lang.reflect.Constructor.acquireConstructorAccessor()
   at java.lang.reflect.Constructor.newInstance(Object[] initargs, CallerID )
   at java.lang.Class.newInstance0(CallerID )
   at java.lang.Class.newInstance(CallerID )
   at java.net.InetAddress.loadImpl(String )
   at java.net.InetAddressImplFactory.create()
   at java.net.InetAddress..cctor()
   --- End of inner exception stack trace ---
   at java.net.InetAddress.getByName(String host)
   at com.android.ddmlib.AndroidDebugBridge..cctor()
   --- End of inner exception stack trace ---
   at com.android.ddmlib.AndroidDebugBridge.createBridge()
   at ALTMakeCallAutoTest.MainForm.MainForm_Load(Object sender, EventArgs e) in D:\複製 -Window_Audio Make Call Auto-Test\ALT Make Call Auto-test\MainForm.cs:line 177
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
ALT Make Call Auto-Test
    Assembly Version: 1.0.0.0
    Win32 Version: 2.0.0.0
    CodeBase: file:///D:/Debug/ALT%20Make%20Call%20Auto-Test.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
NLog
    Assembly Version: 1.0.0.505
    Win32 Version: 1.0.0.505
    CodeBase: file:///D:/Debug/NLog.DLL
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Web
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
System.Messaging
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Messaging/2.0.0.0__b03f5f7f11d50a3a/System.Messaging.dll
----------------------------------------
ddmlib
    Assembly Version: 0.0.0.0
    Win32 Version: 0.0.0.0
    CodeBase: file:///D:/Debug/ddmlib.DLL
----------------------------------------
IKVM.OpenJDK.Core
    Assembly Version: 0.42.0.6
    Win32 Version: 0.42.0.6
    CodeBase: file:///D:/Debug/IKVM.OpenJDK.Core.DLL
----------------------------------------
Com.Asus.Vd.Lib.IO
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///D:/Debug/Com.Asus.Vd.Lib.IO.DLL
----------------------------------------
IKVM.Runtime
    Assembly Version: 0.42.0.6
    Win32 Version: 0.42.0.6
    CodeBase: file:///D:/Debug/IKVM.Runtime.DLL
----------------------------------------
IKVM.OpenJDK.Util
    Assembly Version: 0.42.0.6
    Win32 Version: 0.42.0.6
    CodeBase: file:///D:/Debug/IKVM.OpenJDK.Util.DLL
----------------------------------------
Com.Asus.Vd.Lib.GUI
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///D:/Debug/Com.Asus.Vd.Lib.GUI.DLL
----------------------------------------
Com.Asus.Vd.Lib.Proc
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///D:/Debug/Com.Asus.Vd.Lib.Proc.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:


    


When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


Solution

The MissingMethodException is caused by .NET 2.0 SP1 not being installed. 

沒有留言: