java.lang.ClassNotFoundException在项目中什么都没改变但升级eclipse android sdk后 [英] java.lang.ClassNotFoundException after changing nothing in the project but upgrading eclipse android sdk

查看:27
本文介绍了java.lang.ClassNotFoundException在项目中什么都没改变但升级eclipse android sdk后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

前段时间我开发了一个相当简单的应用程序,目标是4.2.2.我让它在我的设备中正常工作.然后我停止了大约 1 个月的开发.

Some time ago I developed a rather simple app, with a target of 4.2.2. I had it working normally in my device. Then I stopped development for about 1 month.

在最近的 Google I/O 之后,我决定重新开始开发.我首先做的是打开 Android SDK Manager 并更新到新可用的包(我认为这只是 SDK 工具、平台工具,而不是更多).

After the recent Google I/O, I decided to come back to development. What I first did was open the Android SDK Manager and update to the newly available packages (I think it was only the SDK tools, platform tools, and not much more).

然后我尝试运行该项目并得到这个 java.lang.ClassNotFoundException.我检查了一切,完全没有错误,构建成功.

I then tried to run the project and got this java.lang.ClassNotFoundException. I checked everything, no errors at all, building completing successfully.

java.lang.ClassNotFoundException: Didn't find class "com.example.compassgps.CompassGPSActivity" on path: /data/app/com.example.compassgps-2.apk

我尝试了很多事情:清理项目,更改 Android 目标(以防 API17 的新修订导致任何崩溃)...

I have tried a lot of things: cleaned the project, changed Android target (in case the new revisions to API17 had made anything crash)...

我已经搜索了 StackOverflow 已经提出的问题,但没有发现任何对项目进行更改的情况为 NONE.所以我现在感到很沮丧,因为我实际上什么都没改变,而且我的项目已经停止工作:(

I have searched through StackOverflow's already asked questions, but have not found any of the situations in which the changes to the project were NONE. So I am feeling quite frustrated now because I have actually changed NOTHING and my project has stopped working :(

推荐答案

右键单击您的项目转到属性.Java 构建路径.选择订单导出选项卡.确保选择了 Android Private Libraries.如果您有引用的库项目.对图书馆项目也做同样的事情.清理和构建.

Right click on your project goto properties. Java Build Path. Choose Order export tab. Make sure that Android Private Libraries is selected. If you have referenced library project. do the same for the library project also. Clean and Build.

还要转到 android sdk 管理器并检查您是否安装了 android sdk 构建工具.这些不是必需的,但请确保您已安装 android 构建工具.

Also goto android sdk manager and check that you have the android sdk build tools installed. This many not be necessary but make sure you have android build tools installed.

这篇关于java.lang.ClassNotFoundException在项目中什么都没改变但升级eclipse android sdk后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆