基于库的应用程序安装 2 个 APK 文件,而不是一个 - 为什么?

发布于 2024-11-15 02:56:38 字数 556 浏览 8 评论 0原文

我正在尝试重构现有的应用程序,以便除了派生活动中的一些可重写方法之外,所有代码都将驻留在库中。这仍然由于某种原因不起作用,但在这个过程中在尝试解决此问题时,令我沮丧的是,我发现安装了两个 .apk 文件,而不是一个(当我从 eclipse 运行调试会话时):

  1. 第一个(也是较大的文件)是 具有原始库名称。
  2. 第二个(大小只有 20KB)是 具有派生的应用程序名称。

为什么会这样?我在哪里可以了解更多相关信息?

这可以解释我遇到的 ClassNotFoundException 问题吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

三生池水覆流年 2024-11-22 02:56:38

我自己找到了答案。事实证明,我在两个项目的属性中都有 2 个关键设置未正确设置:

  1. 在库项目中,“Is Library”
    由于某种原因没有被检查。我
    我可以发誓我检查过了,但是
    知道Android有多么异想天开
    开发环境下
    Eclipse也可以,我怀疑是这样
    未被 Eclipse(或 ADT
    插件)由于一些故障而导致。
  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. 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文