基于库的应用程序安装 2 个 APK 文件,而不是一个 - 为什么? [英] Library based application installs 2 APK files, not one - Why?

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

问题描述

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

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 大小)是具有派生的应用程序名称.

这是为什么,我可以在哪里了解更多信息?

Why is that and where can I learn more about this?

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

Could that explain the ClassNotFoundException problem I am having?

推荐答案

我自己找到了答案.事实证明,我在两个项目的属性中都有 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. 在库项目中,是库"由于某种原因没有检查.一世可以发誓我检查过它,但是知道安卓有多异想天开开发环境下Eclipse 可以,我怀疑它未被 Eclipse(或 ADT插件)由于一些小故障.
  2. 在应用项目中,我忽略添加我的库项目作为参考通过添加...按钮.(我能有多蠢?)

希望这对其他新手有用.

Hoping this can be useful for other newbies to come.

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

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