库基于应用程序安装2 APK文件,没有之一 - 为什么? [英] Library based application installs 2 APK files, not one - Why?

查看:97
本文介绍了库基于应用程序安装2 APK文件,没有之一 - 为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图重组,使现有的应用程序,除了在派生活动几覆盖,能够方法,所有code将驻留在库中。这仍然<一href="http://stackoverflow.com/questions/6325826/unable-to-instantiate-activity-caused-by-classnotfoundexception">doesn't出于某种原因的工作,但在试图解决此过程中,我发现了令我失望,有两个的apk安装文件,而不是一个(当我运行调试会话从日食):

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. 在第一个(和更大的文件)是 具有原始的库名称。
  2. 第二(仅在大小20KB)是 其派生的应用程序的名称。
  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?

莫非是解释<一个href="http://stackoverflow.com/questions/6325826/unable-to-instantiate-activity-caused-by-classnotfoundexception">ClassNotFoundException问题我有?

推荐答案

我发现自己的答案。事实证明,我在两个项目的属性2关键设置,设置不正确:

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

  1. 在库项目,是图书馆 未被选中的某些原因。一世 可以发誓,我查了一下,但 知道如何异想天开了Android 在开发环境 Eclipse可以的话,我怀疑它 在未选中的Eclipse(或ADT 插件),因为一些小故障的结果。
  2. 在应用程序项目,我 忘了加我的库项目 作为通过添加一个参考... 按钮。 (我多么愚蠢的可能呢?)
  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.

这篇关于库基于应用程序安装2 APK文件,没有之一 - 为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆