问题描述
我有一个工作Android项目,但从头开始需要。我复制了我的所有的源文件和布局文件了。有没有编译错误,但是当我尝试运行,我碰到下面的错误。
I had a working android project but needed to start from scratch. I copied all my source files and layout files over. There are no compilation errors but when I try to run, I get the following error.
11-27 17:21:56.793: E/AndroidRuntime(1450): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{projects.mobile.mapappproject/projects.mobile.mapappproject.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "projects.mobile.mapappproject.MainActivity" on path: /data/app/projects.mobile.mapappproject-1.apk
我在运行Eclipse JUNO,并试图在Android 4.2上运行。谢谢!
I am running eclipse juno and trying to run on Android 4.2. Thanks !
推荐答案
而不是做复制粘贴尝试以下
Rather than doing copy paste try following
1,创建一个Android应用程序项目
1.Create an android application project
2.删除其上创建Eg.MainActivity和布局。文件
2.Delete the files which was created Eg.MainActivity and layout.
2.右键点击项目名称,然后单击导入,然后从文件system.Go到项目目录从那里导入源
2.Right click on project name and click import ,then from File system.Go to your project directory to import the source from there
3,选择是,然后完成。
3.select that, then finish.
4.Clean和建后运行
4.Clean and build then run
这篇关于ClassNotFoundException的:previously工作Android项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!