开发者

Library based application installs 2 APK files, not one - Why?

I am trying to restructure an existing app so that, except for a few override-able methods in a derived activity, all code will reside in a library. This still doesn't work for some reason, but in the process of attempting to troubleshoot this, I discovered much to my dismay that there are two .apk files installed, not one (when I run a debug session from eclipse):

  1. The first (and larger file) is having the original library name.
  2. The second (only 20KB in size) is having the derived application name.

Why is that and where can I lea开发者_如何学Gorn more about this?

Could that explain the ClassNotFoundException problem I am having?


I found the answer myself. It turns out that I had 2 critical settings in the Properties of both projects not set correctly:

  1. In the library project, "Is Library" was not checked for some reason. I could swear that I checked it, but knowing how whimsical the Android development environment under Eclipse can be, I suspect that it was unchecked by Eclipse (or the ADT plugin) as a result of some glitch.
  2. In the application project, I neglected to add my library project as a reference via the Add... button. (how dumb could I be?)

Hoping this can be useful for other newbies to come.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜