0

我是安卓新手。我正在尝试在eclipse中运行modbusdroid的java代码程序我没有更改任何代码,只下载了最新版本的seroUtils.jar并添加到项目中,因为它丢失了。附上错误日志,当我在 Eclipse源中运行它时请帮助我 - https://github.com/bigcat/ModbusDroid

09-25 17:22:17.806: E/dalvikvm(813): Could not find class 'com.bencatlin.modbusdroid.OldVersion.MbDroidMsgExceptionHandler', referenced from method com.bencatlin.modbusdroid.OldVersion.ModbusDroid.onCreate
09-25 17:22:19.117: E/dalvikvm(813): Could not find class 'com.serotonin.util.queue.ByteQueue', referenced from method com.serotonin.modbus4j.base.ModbusUtils.calculateCRC
09-25 17:22:20.277: E/dalvikvm(813): Could not find class 'com.serotonin.messaging.StreamTransport', referenced from method com.serotonin.modbus4j.ip.tcp.TcpMaster.openConnection
09-25 17:22:20.498: E/dalvikvm(813): Could not find class 'com.serotonin.modbus4j.ip.encap.EncapMessageParser', referenced from method com.serotonin.modbus4j.ip.tcp.TcpMaster.init
09-25 17:22:20.667: E/dalvikvm(813): Could not find class 'com.serotonin.modbus4j.ip.xa.XaMessageParser', referenced from method com.serotonin.modbus4j.ip.tcp.TcpMaster.init
09-25 17:22:20.807: E/dalvikvm(813): Could not find class 'com.serotonin.modbus4j.ip.encap.EncapMessageRequest', referenced from method com.serotonin.modbus4j.ip.tcp.TcpMaster.send
09-25 17:22:20.930: E/dalvikvm(813): Could not find class 'com.serotonin.modbus4j.ip.xa.XaMessageRequest', referenced from method com.serotonin.modbus4j.ip.tcp.TcpMaster.send
09-25 17:22:21.437: E/dalvikvm(813): Could not find class 'com.serotonin.messaging.MessageControl', referenced from method com.serotonin.modbus4j.ModbusMaster.getMessageControl
09-25 17:22:21.797: E/dalvikvm(813): Could not find class 'com.serotonin.messaging.DefaultMessagingExceptionHandler', referenced from method com.serotonin.modbus4j.Modbus.<init>
09-25 17:22:22.002: E/dalvikvm(813): Could not find class 'com.serotonin.messaging.DefaultMessagingExceptionHandler', referenced from method com.serotonin.modbus4j.Modbus.setExceptionHandler
09-25 17:22:22.277: E/AndroidRuntime(813): FATAL EXCEPTION: main
09-25 17:22:22.277: E/AndroidRuntime(813): java.lang.NoClassDefFoundError: com.serotonin.messaging.DefaultMessagingExceptionHandler
09-25 17:22:22.277: E/AndroidRuntime(813):  at com.serotonin.modbus4j.Modbus.<init>(Modbus.java:34)
09-25 17:22:22.277: E/AndroidRuntime(813):  at com.serotonin.modbus4j.ModbusMaster.<init>(ModbusMaster.java:55)
09-25 17:22:22.277: E/AndroidRuntime(813):  at com.serotonin.modbus4j.ip.tcp.TcpMaster.<init>(TcpMaster.java:55)
09-25 17:22:22.277: E/AndroidRuntime(813):  at com.bencatlin.modbusdroid.OldVersion.ModbusTCPMaster.<init>(ModbusTCPMaster.java:23)
09-25 17:22:22.277: E/AndroidRuntime(813):  at com.bencatlin.modbusdroid.OldVersion.ModbusTCPFactory.createModbusTCPMaster(ModbusTCPFactory.java:12)
09-25 17:22:22.277: E/AndroidRuntime(813):  at com.bencatlin.modbusdroid.OldVersion.ModbusDroid.onCreate(ModbusDroid.java:426)
09-25 17:22:22.277: E/AndroidRuntime(813):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
09-25 17:22:22.277: E/AndroidRuntime(813):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
09-25 17:22:22.277: E/AndroidRuntime(813):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
09-25 17:22:22.277: E/AndroidRuntime(813):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
09-25 17:22:22.277: E/AndroidRuntime(813):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
09-25 17:22:22.277: E/AndroidRuntime(813):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-25 17:22:22.277: E/AndroidRuntime(813):  at android.os.Looper.loop(Looper.java:123)
09-25 17:22:22.277: E/AndroidRuntime(813):  at android.app.ActivityThread.main(ActivityThread.java:4627)
09-25 17:22:22.277: E/AndroidRuntime(813):  at java.lang.reflect.Method.invokeNative(Native Method)
09-25 17:22:22.277: E/AndroidRuntime(813):  at java.lang.reflect.Method.invoke(Method.java:521)
09-25 17:22:22.277: E/AndroidRuntime(813):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-25 17:22:22.277: E/AndroidRuntime(813):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-25 17:22:22.277: E/AndroidRuntime(813):  at dalvik.system.NativeStart.main(Native Method)
4

2 回答 2

1

Display.getRotation在 API 级别 8 (Froyo 2.2) 中添加。我猜您使用的是较旧的设备或模拟器。创建一个 API 级别 >= 8 的新 AVD

于 2012-09-25T16:50:17.330 回答
1

我遇到了同样的问题,我解决了将新的 seroutils.jar 放入“库”选项卡中的“java 构建路径”,然后将 jar 签入“订购和导出”选项卡。它永久地解决了这个问题。

于 2013-11-13T18:50:50.110 回答