多应用程序调试

发布于 2024-11-27 00:07:42 字数 1174 浏览 4 评论 0原文

我有一个无法找到解决方案的问题。我正在开发两个不同的 Android 应用程序,它们是一个更大项目的一部分。它们的共同点是相同的包名称。

因此,每个项目的清单如下所示:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.test" android:versionCode="1"
 android:versionName="1.0">

两个应用程序都工作正常,但当我调试应用程序 1 时,它会覆盖设备上的应用程序 2。然后,当我尝试调试应用程序 2 时,出现此错误:

New package not yet registered with the system. Waiting 3 seconds before next attempt.
ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.test/.RegistrationActivity }
ActivityManager: Error type 3
ActivityManager: Error: Activity class {com.test/com.test.RegistrationActivity} does not exist.

其中 RegistrationAcitvity 是应用程序启动时我启动的 Activity

我发现,如果我清理应用程序 2,那么它就会正确安装和启动。但是,完成此操作后,应用程序 1 将不再显示在设备上。奇怪的是,我总是能够从 Eclipse 启动应用程序 1,但这样做后我又回到上面的错误,这可以再次通过应用程序 2 上的 clean 来修复。

另一个奇怪的事情可能是或者可能与此无关的是,每次我启动应用程序 1 时,Eclipse 都会自动选择我插入的设备。但是,当我启动应用程序 2 时,Eclipse 总是提示我选择一个设备。是的,调试配置中的部署目标选项设置为自动——我不确定这是否相关。

任何帮助表示赞赏!

I have an issue that I cannot find a solution for. I am developing two different Android apps that are a part of a larger project. The one thing they have in common is the same package name.

So my manifest looks like this for each project:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.test" android:versionCode="1"
 android:versionName="1.0">

Both apps works fine, but when I debug App 1, it overwrites App 2 on the device. Then when I try to debug App 2, I get this error:

New package not yet registered with the system. Waiting 3 seconds before next attempt.
ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.test/.RegistrationActivity }
ActivityManager: Error type 3
ActivityManager: Error: Activity class {com.test/com.test.RegistrationActivity} does not exist.

Where RegistrationAcitvity is the Activity I am launching when the app starts.

I have found that if I clean App 2, then it installs and launches correctly. However, when this is done, App 1 no longer shows up on the device. Oddly enough, I am always able to launch App 1 from Eclipse, but after doing so I am back to the error above, which can again be fixed by clean on App 2.

The other strange thing that may or may not have something to do with this is the fact that every time I launch App 1, Eclipse automatically chooses the device I have plugged in. However, when I launch App 2, Eclipse always prompts me to choose a device. And yes, the deployment target option in the debug configuration is set to automatic -- I'm not sure if this is related or not.

Any help is appreciated!

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

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

发布评论

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

评论(1

桜花祭 2024-12-04 00:07:42

Android 包的包名称必须是唯一的。

应用程序的完整 Java 语言样式包名称。名称
应该是独一无二的。名称可以包含大写或小写字母
(“A”到“Z”)、数字和下划线(“_”)。然而,个人
包名称部分只能以字母开头。

避免冲突
与其他开发人员一起,您应该使用互联网域名所有权作为
包名称的基础(相反)。例如,应用程序
由 Google 发布,以 com.google 开头。你也不应该使用
发布应用程序时的 com.example 命名空间。


包名称充当应用程序的唯一标识符。它是
也是应用程序进程的默认名称(请参阅
元素的 process 属性)和默认值
活动的任务关联性(参见元素的
taskAffinity 属性)。

来源

The package name for Android packages need to be unique.

A full Java-language-style package name for the application. The name
should be unique. The name may contain uppercase or lowercase letters
('A' through 'Z'), numbers, and underscores ('_'). However, individual
package name parts may only start with letters.

To avoid conflicts
with other developers, you should use Internet domain ownership as the
basis for your package names (in reverse). For example, applications
published by Google start with com.google. You should also never use
the com.example namespace when publishing your applications.

The
package name serves as a unique identifier for the application. It's
also the default name for the application process (see the
element's process process attribute) and the default
task affinity of an activity (see the element's
taskAffinity attribute).

source

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