Bug 52114 - [Empower Error Message]Ensure that the application has been installed to the target device and has a launchable activity (MainLauncher = true).
Summary: [Empower Error Message]Ensure that the application has been installed to the ...
Status: CONFIRMED
Alias: None
Product: Android
Classification: Xamarin
Component: General (show other bugs)
Version: 7.1 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2017-01-31 18:44 UTC by Jon Douglas [MSFT]
Modified: 2017-06-14 21:28 UTC (History)
3 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Jon Douglas [MSFT] 2017-01-31 18:44:31 UTC
*Description:

```
The application could not be started.
Ensure that the application has been installed to the target device and has a launchable activity (MainLauncher = true).  
Additionally, check Build->Configuration Manager to ensure this project is set to Deploy for this configuration.
```

This error message for the most part gets caught in a couple of scenarios that I've seen in the past:

1) The Build->Configuration Manager does not have "Deploy" checked for the current configuration

2) The previously installed package differs from the "to be" installed package in some fashion and thus does not install the package and gives this error verbatim.

In scenario 2), this error message is not helpful at all. In fact it confuses most of our customers into thinking they did something incorrect when in reality they did not. You can see a few example cases of this here:

http://stackoverflow.com/questions/34294649/xamarin-android-visual-studio-the-application-could-not-be-started

http://stackoverflow.com/questions/12281590/android-debugger-error-monodroid

https://forums.xamarin.com/discussion/19902/the-application-could-not-be-started-error-when-debuging-andorid-project-in-visual-sutido

The ways to resolve the error when it comes to 2) I've noticed in the past:

`adb uninstall <package name>` (Where <package name> is their application package name)

However this only sometimes resolves the issue, one might also want to consider removing the Shared Runtime and API Support packages:

`adb uninstall Mono.Android.DebugRuntime`

`adb uninstall Mono.Android.Platform.ApiLevel_X` (Where X is the API level)

Typically removing these two packages as well as the application package will resolve the issue.

Another solution I've seen in the past is to rename the application package.

*Proposal:

Empower this error message to include a snippet on the lines of these three commands to help customers resolve the problem. Something along the lines of:

```
The application could not be started.

Ensure that the application has been installed to the target device and has a launchable activity (MainLauncher = true).
  
Check the Build->Configuration Manager to ensure this project is set to Deploy for this configuration.

Additionally you may want to ensure to remove the following packages for a fresh install:

`adb uninstall <package name>`
`adb uninstall Mono.Android.DebugRuntime`
`adb uninstall Mono.Android.Platform.ApiLevel_X`
```

If there's a better way we can protect our customers from hitting this issue, I'd love to discuss that. I see this issue almost daily and figured it is a great time to bring it up and chat about.

Note You need to log in before you can comment on or make changes to this bug.