关于java调用matlab程序早已实现,今早做了一个实验,java能调用m文件,而android上面运行就发生错误,说找不到这个类(配置和在java例子一样),为什么会这样的?
android错误信息:
11-03 02:30:31.598: E/Trace(1463): error opening trace file: No such file or directory (2)
11-03 02:30:32.279: E/dalvikvm(1463): Could not find class 'operation.operation', referenced from method com.example.matlabtest.MainActivity$1.run
11-03 02:30:32.299: E/AndroidRuntime(1463): FATAL EXCEPTION: main
11-03 02:30:32.299: E/AndroidRuntime(1463): java.lang.VerifyError: com/example/matlabtest/MainActivity$1
11-03 02:30:32.299: E/AndroidRuntime(1463): at com.example.matlabtest.MainActivity.onCreate(MainActivity.java:21)
11-03 02:30:32.299: E/AndroidRuntime(1463): at android.app.Activity.performCreate(Activity.java:5104)
11-03 02:30:32.299: E/AndroidRuntime(1463): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
11-03 02:30:32.299: E/AndroidRuntime(1463): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
11-03 02:30:32.299: E/AndroidRuntime(1463): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
11-03 02:30:32.299: E/AndroidRuntime(1463): at android.app.ActivityThread.access$600(ActivityThread.java:141)
11-03 02:30:32.299: E/AndroidRuntime(1463): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
11-03 02:30:32.299: E/AndroidRuntime(1463): at android.os.Handler.dispatchMessage(Handler.java:99)
11-03 02:30:32.299: E/AndroidRuntime(1463): at android.os.Looper.loop(Looper.java:137)
11-03 02:30:32.299: E/AndroidRuntime(1463): at android.app.ActivityThread.main(ActivityThread.java:5041)
11-03 02:30:32.299: E/AndroidRuntime(1463): at java.lang.reflect.Method.invokeNative(Native Method)
11-03 02:30:32.299: E/AndroidRuntime(1463): at java.lang.reflect.Method.invoke(Method.java:511)
11-03 02:30:32.299: E/AndroidRuntime(1463): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
11-03 02:30:32.299: E/AndroidRuntime(1463): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
11-03 02:30:32.299: E/AndroidRuntime(1463): at dalvik.system.NativeStart.main(Native Method)
据说找不到这个类,到现在还没有解决。。。
android matlab 类 java
------解决方案--------------------
Could not find class 'operation.operation' 这个类在android 工程里面有没有?
如果有还报错那就是 编译的版本不匹配造成的。