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

為{幸葍}努か 提交于 2019-12-10 16:02:12

问题


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 learn more about this?

Could that explain the ClassNotFoundException problem I am having?


回答1:


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.



来源:https://stackoverflow.com/questions/6332871/library-based-application-installs-2-apk-files-not-one-why

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!