Good day.
For some reason, if my class inherits a class that is defined in a JAR file, ClassLoader throws an exception that it cannot find the class. However, if you do not inherit the class, then everything works.

I copied the android-support-v4.jar problem library from android-sdk to $ (PROJECT_PATH) / jars , then connected it in the project as seen in the picture

alt text

However, at start, the NotClassFoundError exception is thrown, and before that a message is written to the log:

> > 04-16 23:09:32.131: W/dalvikvm(1571): > Unable to resolve superclass of > Lbt/nativeclient/TorrentAdapter; (8) > > 04-16 23:09:32.171: W/dalvikvm(1571): > Link of class > 'Lbt/nativeclient/TorrentAdapter;' > failed 

Actually my code that inherits the PagerAdapter class from the library:

 package bt.nativeclient; import; import android.view.View; public class TorrentAdapter extends PagerAdapter { public TorrentAdapter() { } @Override public int getCount() { // TODO Auto-generated method stub return 0; } @Override public boolean isViewFromObject(View arg0, Object arg1) { // TODO Auto-generated method stub return false; } } 

I suspect that I did not take into account any small detail when working with eclipse. Can anybody help me with this problem, maybe somewhere I need to add ways? Thank.

  • If I'm not mistaken, when working with jar, you need to load classes with handles. Here is a presentation about working with jar . - andrybak
  • one
    Add external jars ... you specify the path to the file and that's it .. before that, delete all the import in the class, then peredavod ... - Gorets
  • four
    I do this: I throw in libs, -> Add external jars -> Order and export and put a daw! - katso

1 answer 1

Starting with ADT 17 (if I remember everything correctly) you just need to put it in libs, the plugin itself adds jark to the buildpath, to the Android Dependencies section, to apk also adds an automatic one. Manually in the buildpase it should not be assigned, if there is, remove it.

If not pulled from libs - this is a glitch. Wedge, if it does not help - to restart the Eclipse, once again a wedge.