Could not find class

2020-02-06 11:07发布

问题:

My project ran well until I clicked "Help->Check for updates" and installed some components in Android SDK Manager.

In general, there is no error announced in my project. But when I run my project, it causes an error

could not find class com.androiquery.AQuery

I checked out again, I still can see the AQuery library in libs folder and also the reference to this library.

I also tried to clean the project and its dependencies, quite the eclipse, restart the computer, but it doesn't solve. Do you know how to fix it?

回答1:

I have had the same issue as you and have fixed it this way.

Go to Properties > Java Build Path > Order and Export and check the Android Private Libraries box.

See the screenshot below:



回答2:

It may be one of the following reasons:

  1. Setup problems: adding the jar files manually as well as setting the project type to use Google APIs. This cause problems for some reason.
  2. You are calling activity may be inheriting some class that causes this problem.


回答3:

I assume your are using ADT? if you are, you can download a .zip with all files in it. From the android developer site



回答4:

Thanks @Raghunandan. The solution is right click on project. goto java build path. choose order export tab. make sure android private libraries is check. Clean and build. Also make sure you have android sdk build tools from the sdk manager