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)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 52114 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

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.