Xamarin - Android - Visual Studio - The application could not be started
Solution 1
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.
Solution 2
Renamed Application name.
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.
Solution 3
Running this command from the adb shell solved it for me:
adb shell pm uninstall -k com.packagename
To access the adb shell from Visual Studio Tools -> Android -> Android Adb Command Prompt.
Very interesting error, seems like Visual Studio is unable to unistall the previous version completely.
Solution 4
Obviously the OP figured out the issue to their problem but I still wanted to post an answer relating to an issue I had with the same error message. I am using Visual Studio (within Parallels) and attempting to debug the app on a Xamarin Android Player instance (which is running on my Mac).
I kept getting this error and realized that a different, more helpful, error message was showing up in the Build Output saying that I was not supporting the correct architecture.
Heading into the Android Project Properties -> Android Options -> Advanced -> and checking x86
finally allowed my to successfully deploy to the Xamarin Android Player.
Solution 5
The ADB approach does not worked for me. I did not want to factory reset my phone nor uninstall my apps so I have managed to deploy by changing the package.
- Right click on your Droid project
- Select Properties
- Got to Application Manifest
- Change the Package name
- Re-deploy your project
Hope this helps
Related videos on Youtube
Jared Price
Currently working on mostly cross platform mobile apps with Xamarin (C#). JavaScript, C++ (Qt), Java, Objective-C, MySQL, etc... Also working on a cross platform 2D space game. Currently working on LAN features.
Updated on January 07, 2021Comments
-
Jared Price over 3 years
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.
-
cmeeren about 8 yearsThis fixed it for me, though I was able to uninstall it simply by going to Settings -> Apps -> All, where it was present even though there was no launcher in the app drawer.
-
Al Lelopath about 8 yearsWhere is this section?
-
Al Lelopath about 8 yearsFound it ... ProjectName.Native.Droid properties > Android Options > Advanced. Was already checked.
-
cfl almost 8 yearsHave a look at the Build ouput, to see if storage is an issue: >Deployment failed because of an internal error: There is not enough storage space on the device to store package: /data/local/tmp/Mono.Android.Platform.ApiLevel_23.apk. Free up some space and try again.
-
pampi over 7 yearsSettings > Application manager > NameOfYourApplication > Uninstall
-
DisibioAaron over 7 yearsThanks! I renamed the application then it worked. I then renamed it back and it started working again on my phone.
-
Vishnu Babu about 7 yearsThis helped me as well, The package name went missing somehow, which was there previously..
-
Jared Price about 7 yearsI would highly recommend against Factory Resetting since it will delete most of what's on your phone. This should only be done as an absolute last resort if all other means of uninstalling the application have been exhausted.
-
Jared Price about 7 yearsChanging the package name does not get rid of the previously installed application. It just creates an entirely new application on your device. If this is an application that exists on the Google Play store it isn't really an acceptable solution.
-
ndarriulat about 7 years@JaredPrice Yes I agree, in my case I had no data saved on that emulator so it was not a problem.
-
Lepidopteron about 7 yearsThank you! Short: use the adb terminal approach. Easy to get there in Visual Studio: TOOLS-->Android-->"Android Adb Command Prompt..."
-
Olorunfemi Davis over 5 yearsOnly this worked for me. <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <!--<category android:name="com.booksrite.Booksrite" />--> </intent-filter>