Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
233 views
in Technique[技术] by (71.8m points)

android - Unable to resolve superclass error when referencing .jar library

  1. I did an Android project and run it. It ran successfully.
  2. I developed a web service in Java and hosted it. It ran successfully.
  3. I exported the webservice into a .jar and added it to my Android project.
  4. When I try to call a method in the web service I get an Unable to resolve superclass error.

My error log:

Unable to resolve superclass of Lweb/service/RandomWordGeneratorService; (73)
Link of class 'Lweb/service/RandomWordGeneratorService;' failed 
Could not find class 'web.service.RandomWordGeneratorService',
    referenced from method tam.miru.Login$1.onClick
VFY: unable to resolve new-instance 110 Lweb/service/RandomWordGeneratorService;)
    in Ltam/miru/Login$1; 
VFY: replacing opcode 0x22 at 0x005a    
VFY: dead code 0x005c-006e in Ltam/miru/Login$1;.onClick (Landroid/view/View;)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Just started to get this issue after upgrading to ADT 17.

Discovered that external .jar files need to be in a 'libs' (with an s) folder otherwise their classes are not included in the .dex file that is created. Before the upgrade everything worked fine with my .jar files in a 'lib' folder (no s).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...