将Android应用程序项目从Windows导入Mac / Eclipse

时间:2014-05-05 10:57:21

标签: android eclipse macos

我在Windows上开发了一个Android应用程序,它工作得很好!也在我的设备(三星年轻)上工作,但当我将它导入Mac时,我遇到了在Galaxy S3上启动它的问题。我可以提到代码是正确的,并且在设备中安装它时没有错误,问题是当它在设备上运行时它会突然停止并显示一条消息“不幸的是MySupermarket已经停止了”。

我需要你的帮助,因为我不是高级开发人员。

这是LogCat:

05-05 14:18:57.245: D/AndroidRuntime(5615): Shutting down VM
05-05 14:18:57.245: W/dalvikvm(5615): threadid=1: thread exiting with uncaught exception (group=0x41c30700)

05-05 14:18:57.245: E/AndroidRuntime(5615): FATAL EXCEPTION: main
05-05 14:18:57.245: E/AndroidRuntime(5615): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.mysupermarket2/com.example.mysupermarket2.adwaa.mysupermarket2.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.mysupermarket2.adwaa.mysupermarket2.MainActivity" on path: /data/app/com.example.mysupermarket2-2.apk
05-05 14:18:57.245: E/AndroidRuntime(5615):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2219)
05-05 14:18:57.245: E/AndroidRuntime(5615):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
05-05 14:18:57.245: E/AndroidRuntime(5615):     at android.app.ActivityThread.access$700(ActivityThread.java:159)
05-05 14:18:57.245: E/AndroidRuntime(5615):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
05-05 14:18:57.245: E/AndroidRuntime(5615):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-05 14:18:57.245: E/AndroidRuntime(5615):     at android.os.Looper.loop(Looper.java:176)
05-05 14:18:57.245: E/AndroidRuntime(5615):     at android.app.ActivityThread.main(ActivityThread.java:5419)
05-05 14:18:57.245: E/AndroidRuntime(5615):     at java.lang.reflect.Method.invokeNative(Native Method)
05-05 14:18:57.245: E/AndroidRuntime(5615):     at java.lang.reflect.Method.invoke(Method.java:525)
05-05 14:18:57.245: E/AndroidRuntime(5615):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
05-05 14:18:57.245: E/AndroidRuntime(5615):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
05-05 14:18:57.245: E/AndroidRuntime(5615):     at dalvik.system.NativeStart.main(Native Method)
05-05 14:18:57.245: E/AndroidRuntime(5615): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.mysupermarket2.adwaa.mysupermarket2.MainActivity" on path: /data/app/com.example.mysupermarket2-2.apk
05-05 14:18:57.245: E/AndroidRuntime(5615):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:64)
05-05 14:18:57.245: E/AndroidRuntime(5615):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-05 14:18:57.245: E/AndroidRuntime(5615):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
05-05 14:18:57.245: E/AndroidRuntime(5615):     at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
05-05 14:18:57.245: E/AndroidRuntime(5615):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2210)
05-05 14:18:57.245: E/AndroidRuntime(5615):     ... 11 more

执行以下步骤后问题仍然存在,这是以下步骤后的LogCat:

05-05 15:17:10.980: E/AndroidRuntime(8017): FATAL EXCEPTION: main
05-05 15:17:10.980: E/AndroidRuntime(8017): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.mysupermarket2/com.example.mysupermarket2.adwaa.mysupermarket2.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.mysupermarket2.adwaa.mysupermarket2.MainActivity" on path: /data/app/com.example.mysupermarket2-1.apk
05-05 15:17:10.980: E/AndroidRuntime(8017):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2219)
05-05 15:17:10.980: E/AndroidRuntime(8017):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
05-05 15:17:10.980: E/AndroidRuntime(8017):     at android.app.ActivityThread.access$700(ActivityThread.java:159)
05-05 15:17:10.980: E/AndroidRuntime(8017):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
05-05 15:17:10.980: E/AndroidRuntime(8017):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-05 15:17:10.980: E/AndroidRuntime(8017):     at android.os.Looper.loop(Looper.java:176)
05-05 15:17:10.980: E/AndroidRuntime(8017):     at android.app.ActivityThread.main(ActivityThread.java:5419)
05-05 15:17:10.980: E/AndroidRuntime(8017):     at java.lang.reflect.Method.invokeNative(Native Method)
05-05 15:17:10.980: E/AndroidRuntime(8017):     at java.lang.reflect.Method.invoke(Method.java:525)
05-05 15:17:10.980: E/AndroidRuntime(8017):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
05-05 15:17:10.980: E/AndroidRuntime(8017):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
05-05 15:17:10.980: E/AndroidRuntime(8017):     at dalvik.system.NativeStart.main(Native Method)
05-05 15:17:10.980: E/AndroidRuntime(8017): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.mysupermarket2.adwaa.mysupermarket2.MainActivity" on path: /data/app/com.example.mysupermarket2-1.apk
05-05 15:17:10.980: E/AndroidRuntime(8017):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:64)
05-05 15:17:10.980: E/AndroidRuntime(8017):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-05 15:17:10.980: E/AndroidRuntime(8017):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
05-05 15:17:10.980: E/AndroidRuntime(8017):     at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
05-05 15:17:10.980: E/AndroidRuntime(8017):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2210)
05-05 15:17:10.980: E/AndroidRuntime(8017):     ... 11 more

1 个答案:

答案 0 :(得分:0)

要修复此异常,请转到Eclipse,右键单击Project properties。您将从左侧菜单中单击Java Build Path并在右侧单击Order and Export选项卡中弹出属性。在该选项卡内取消选中Android Dependencies,之后只需清理您的构建并再次运行。