Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin - Android - Visual Studio - The application could not be started

I was working on an Android project using Xamarin in Visual Studio 2012. I recently upgraded from an HDD to a SSD so I reinstalled Windows and all of my programs.

After cloning my git repository and trying to run the application on my device, I have not been able to get it to run. I was able to start a new hello world project and I got that to run, but I can't get this project to run.

This is what the error says:

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.

I have searched for a solution to this issue but have been unable to find anything that worked.

like image 665
Jared Price Avatar asked Dec 15 '15 16:12

Jared Price


2 Answers

I solved the issue. Somehow the application still existed on my device even though it did not show up in my applications and I needed to remove it.

The solution was to find an old APK that I had emailed and I installed that. Then I uninstalled the application and deployed it again from Visual Studio. This time it worked.

You can read more here: https://forums.xamarin.com/discussion/8501/install-failed-update-incompatible

EDIT (March 13th, 2017):

Seems a lot of people found this answer useful so I decided I should update it with an alternate method to uninstall the app if you don't have access to an old version.

As Atul Chaudhary and Nestel mentioned, you can open up your adb command prompt and run adb uninstall <com.your.application.package.name>. If there are any remnants of your application which remain this should get rid of them.

like image 113
Jared Price Avatar answered Nov 11 '22 17:11

Jared Price


enter image description here

  1. Renamed Application name.

  2. Added Package name.

App. started working on Emulator, Renamed application again, app. continued to run.

Note: Resetting device, un-installing the app. and related runtime etc. from settings did not work for me.

Hope this helps someone.

like image 9
Faizal Balsania Avatar answered Nov 11 '22 17:11

Faizal Balsania