我已将现有项目导入eclipse和所有需要的库,现在没有任何错误。但是,当我尝试编译应用程序时,它仍然会崩溃,因为它应该在Android设备上运行。这是logcat文件:
07-16 18:49:13.187: E/AndroidRuntime(12183): FATAL EXCEPTION: main
07-16 18:49:13.187: E/AndroidRuntime(12183): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{si.dvanadva.evanturist/si.dvanadva.evanturist.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "si.dvanadva.evanturist.MainActivity" on path: /data/app/si.dvanadva.evanturist-2.apk
07-16 18:49:13.187: E/AndroidRuntime(12183): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
07-16 18:49:13.187: E/AndroidRuntime(12183): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
07-16 18:49:13.187: E/AndroidRuntime(12183): at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-16 18:49:13.187: E/AndroidRuntime(12183): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-16 18:49:13.187: E/AndroidRuntime(12183): at android.os.Handler.dispatchMessage(Handler.java:99)
07-16 18:49:13.187: E/AndroidRuntime(12183): at android.os.Looper.loop(Looper.java:137)
07-16 18:49:13.187: E/AndroidRuntime(12183): at android.app.ActivityThread.main(ActivityThread.java:5041)
07-16 18:49:13.187: E/AndroidRuntime(12183): at java.lang.reflect.Method.invokeNative(Native Method)
07-16 18:49:13.187: E/AndroidRuntime(12183): at java.lang.reflect.Method.invoke(Method.java:511)
07-16 18:49:13.187: E/AndroidRuntime(12183): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-16 18:49:13.187: E/AndroidRuntime(12183): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-16 18:49:13.187: E/AndroidRuntime(12183): at dalvik.system.NativeStart.main(Native Method)
07-16 18:49:13.187: E/AndroidRuntime(12183): Caused by: java.lang.ClassNotFoundException: Didn't find class "si.dvanadva.evanturist.MainActivity" on path: /data/app/si.dvanadva.evanturist-2.apk
07-16 18:49:13.187: E/AndroidRuntime(12183): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
07-16 18:49:13.187: E/AndroidRuntime(12183): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-16 18:49:13.187: E/AndroidRuntime(12183): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-16 18:49:13.187: E/AndroidRuntime(12183): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
07-16 18:49:13.187: E/AndroidRuntime(12183): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
07-16 18:49:13.187: E/AndroidRuntime(12183): ... 11 more
07-16 18:49:27.664: E/fb4a(:<default>):MmsConfig(12350): MmsConfig.loadMmsSettings mms_config.xml missing uaProfUrl setting
有人可以帮我解决这个问题吗?
答案 0 :(得分:0)
您已将库添加到Eclipse,但可能不会部署到已部署的APK。这些库应该放在你的libs文件夹中(或资产,取决于Android的版本)。
换句话说,您可能将您的jar放在Eclipse项目工作区的某个文件夹中,并告诉Eclipse它就在那里。但是当你部署你的APK时,它不会问Eclipse“我在哪里找到这些库?”它将在指定的文件夹(libs,assets)中查找它们。
答案 1 :(得分:0)
项目属性,订单和导出选项卡中的Java构建路径,选中所有复选框(私有库等...