我按照here记下的步骤进行了操作。当我尝试使用adb命令重新启动应用程序时出现问题。 LogCat显示错误:
01-26 20:40:30.455: E/AndroidRuntime(418): java.lang.RuntimeException: Unable to instantiate instrumentation ComponentInfo{com.google.android.testing.nativedriver.simplelayouts/com.google.android.testing.nativedriver.server.ServerInstrumentation}: java.lang.ClassNotFoundException: com.google.android.testing.nativedriver.server.ServerInstrumentation in loader dalvik.system.PathClassLoader[/data/app/com.google.android.testing.nativedriver.simplelayouts-1.apk:/data/app/com.google.android.testing.nativedriver.simplelayouts-1.apk]
01-26 20:40:30.455: E/AndroidRuntime(418): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4202)
01-26 20:40:30.455: E/AndroidRuntime(418): at android.app.ActivityThread.access$3000(ActivityThread.java:125)
01-26 20:40:30.455: E/AndroidRuntime(418): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)
01-26 20:40:30.455: E/AndroidRuntime(418): at android.os.Handler.dispatchMessage(Handler.java:99)
01-26 20:40:30.455: E/AndroidRuntime(418): at android.os.Looper.loop(Looper.java:123)
01-26 20:40:30.455: E/AndroidRuntime(418): at android.app.ActivityThread.main(ActivityThread.java:4627)
01-26 20:40:30.455: E/AndroidRuntime(418): at java.lang.reflect.Method.invokeNative(Native Method)
01-26 20:40:30.455: E/AndroidRuntime(418): at java.lang.reflect.Method.invoke(Method.java:521)
01-26 20:40:30.455: E/AndroidRuntime(418): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-26 20:40:30.455: E/AndroidRuntime(418): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-26 20:40:30.455: E/AndroidRuntime(418): at dalvik.system.NativeStart.main(Native Method)
01-26 20:40:30.455: E/AndroidRuntime(418): Caused by: java.lang.ClassNotFoundException: com.google.android.testing.nativedriver.server.ServerInstrumentation in loader dalvik.system.PathClassLoader[/data/app/com.google.android.testing.nativedriver.simplelayouts-1.apk:/data/app/com.google.android.testing.nativedriver.simplelayouts-1.apk]
01-26 20:40:30.455: E/AndroidRuntime(418): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
01-26 20:40:30.455: E/AndroidRuntime(418): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
01-26 20:40:30.455: E/AndroidRuntime(418): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
01-26 20:40:30.455: E/AndroidRuntime(418): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4199)
我已将所有内容都放在库路径中。
答案 0 :(得分:1)
真棒。 在eclipse的Build Path设置中,我按顺序移动了server-standalone.jar文件,然后就可以了。
答案 1 :(得分:0)
我之前遇到过同样的问题,我的解决方案是确保我的jar文件在Eclipse中正确引用,然后重建示例布局项目。这会将罐子滚动到构建中,以便在运行时找到它们。