0

我使用本教程让 Eclipse、Scala 和 Android 启动并运行: http ://scala-ide.org/docs/tutorials/androiddevelopment/index.html

我还拿了这个网页的示例源代码(删除 MainActivity.java - 创建 MainActivity.scala)。

运行应用程序,我收到错误消息:

01-15 18:14:06.740: I/dalvikvm(27536): Failed resolving Lcom/test/helloworldscala/MainActivity; interface 540 'Lscala/ScalaObject;'
01-15 18:14:06.740: W/dalvikvm(27536): Link of class 'Lcom/test/helloworldscala/MainActivity;' failed
01-15 18:14:06.740: D/AndroidRuntime(27536): Shutting down VM
01-15 18:14:06.740: W/dalvikvm(27536): threadid=1: thread exiting with uncaught exception (group=0x415fd2a0)
01-15 18:14:06.740: E/AndroidRuntime(27536): FATAL EXCEPTION: main
01-15 18:14:06.740: E/AndroidRuntime(27536): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.test.helloworldscala/com.test.helloworldscala.MainActivity}: java.lang.ClassNotFoundException: com.test.helloworldscala.MainActivity
01-15 18:14:06.740: E/AndroidRuntime(27536):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2024)
01-15 18:14:06.740: E/AndroidRuntime(27536):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
01-15 18:14:06.740: E/AndroidRuntime(27536):    at android.app.ActivityThread.access$600(ActivityThread.java:140)
01-15 18:14:06.740: E/AndroidRuntime(27536):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
01-15 18:14:06.740: E/AndroidRuntime(27536):    at android.os.Handler.dispatchMessage(Handler.java:99)
01-15 18:14:06.740: E/AndroidRuntime(27536):    at android.os.Looper.loop(Looper.java:137)
01-15 18:14:06.740: E/AndroidRuntime(27536):    at android.app.ActivityThread.main(ActivityThread.java:4898)
01-15 18:14:06.740: E/AndroidRuntime(27536):    at java.lang.reflect.Method.invokeNative(Native Method)
01-15 18:14:06.740: E/AndroidRuntime(27536):    at java.lang.reflect.Method.invoke(Method.java:511)
01-15 18:14:06.740: E/AndroidRuntime(27536):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
01-15 18:14:06.740: E/AndroidRuntime(27536):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
01-15 18:14:06.740: E/AndroidRuntime(27536):    at dalvik.system.NativeStart.main(Native Method)
01-15 18:14:06.740: E/AndroidRuntime(27536): Caused by: java.lang.ClassNotFoundException: com.test.helloworldscala.MainActivity
01-15 18:14:06.740: E/AndroidRuntime(27536):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
01-15 18:14:06.740: E/AndroidRuntime(27536):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
01-15 18:14:06.740: E/AndroidRuntime(27536):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
01-15 18:14:06.740: E/AndroidRuntime(27536):    at android.app.Instrumentation.newActivity(Instrumentation.java:1057)
01-15 18:14:06.740: E/AndroidRuntime(27536):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2015)
01-15 18:14:06.740: E/AndroidRuntime(27536):    ... 11 more

有谁知道这里有什么问题?

4

1 回答 1

0

我必须在 Scala 2.10 中使用每晚构建的 Scala-IDE,然后它才能完美运行。

于 2013-01-18T13:36:25.853 回答