开发者

Multiple App Debugging

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 b开发者_Go百科e 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!


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜