多应用程序调试
我有一个无法找到解决方案的问题。我正在开发两个不同的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Android 包的包名称必须是唯一的。
来源
The package name for Android packages need to be unique.
source