locked
Debug on device RRS feed

  • Question

  • User49100 posted

    I have HTC One X and since I upgraded to Xamarin 4 I can't push app to my device trough Visual Studio. Not in debug or release.

    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 MainLauncher activity and project is set to deploy for both debug and release but I still get this message.

    Monday, November 23, 2015 9:48 AM

Answers

  • User176303 posted

    I managed to fix this by going into "Settings >Application manager > All" and deleting my application.

    then go back and re-deploy.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, December 8, 2015 4:01 PM

All replies

  • User58109 posted

    I have the same problem...probably even though the deploy button is checked, in fact it isn't. I am trying to make sure that this is not the case be detecting diffs on the csproj file.

    Saturday, December 5, 2015 6:20 PM
  • User98607 posted

    Try deleting /bin & /obj folder from project folder. Also delete apk mono framework from your phone. If you can not fix, return to Xamarin 3 until new update.

    Saturday, December 5, 2015 7:17 PM
  • User73084 posted

    I have the same problem (among others after upgrading) and the suggestion from Beray did not work.

    Monday, December 7, 2015 9:22 PM
  • User176303 posted

    I managed to fix this by going into "Settings >Application manager > All" and deleting my application.

    then go back and re-deploy.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, December 8, 2015 4:01 PM
  • User21404 posted

    I will agree with RichardL above. Don't know what happened to my Android project. Just wouldn't work today and had this error and problem. tried deleting bin and obj and full clean. didn't help. What ended up working was simply going to my phone and application manager and finding my project on phone and uninstall, then it worked

    Monday, December 14, 2015 2:06 PM
  • User91222 posted

    @RichardL said: I managed to fix this by going into "Settings >Application manager > All" and deleting my application.

    then go back and re-deploy.

    Thanks a lot.

    Tuesday, December 29, 2015 10:35 AM
  • User40046 posted

    Thanks for posting this. My app started failing sometime last week due to this very issue. Deleting the apps obj/bin directories along with deleting the app from the phone from the application manager works. But not the first time. The app was reinstalled to the phone, but was shown to not be installed for my phone user. After deleting it again, it began to work correctly. So much productivity lost tracking down goofy bugs...

    Friday, January 1, 2016 11:43 PM
  • User482 posted

    "Settings >Application manager > All" - I found I had to remove all applications from Xamarin (frameworks) then it worked. Just removing my app didn't do the trick.

    Saturday, January 9, 2016 6:41 PM
  • User98149 posted

    I had similar problems after updating to Xamarin 4. Neither of the solutions provided above worked for me. In order to fix the debugger I had to downgrade Xamarin to version 3. It can be done here:

    https://store.xamarin.com/account/my/subscription/downloads#xamarin3

    Wednesday, January 20, 2016 10:14 AM
  • User62876 posted

    This is how I got it to work open adb command prompt type adb uninstall <Your app's package name> Then Clean, Build and Deploy

    Friday, January 29, 2016 3:18 PM
  • User193703 posted

    Hi Folks, i've the same problem, but i can't unistall my app, there isn't on my device. Can You Help me?

    Friday, February 12, 2016 4:29 PM
  • User55527 posted

    @RubenIamundo

    In Android Build Settings, Android Options -> Advanced check that x86 architecture is checked! (android emulator runs on x86)

    If this will not helps, please post your build and debug output!

    Tuesday, March 1, 2016 2:00 PM
  • User171749 posted

    @RubenIamundo said: Hi Folks, i've the same problem, but i can't unistall my app, there isn't on my device. Can You Help me?

    It won't be under the downloaded apps section, Try looking at the All section in Applications manager but its varies between phone

    Tuesday, March 1, 2016 2:13 PM
  • User205525 posted

    I want to reply here because I had the same problem but different solution.

    I am using Visual Studio 2015's Xamarin to develop. I had my solution set to deploy. I had selected both x86 and x64 in my project's Android Options. I did not have my app in the applications list (Emulator Android -> Settings -> Apps). Still I ran shell to uninstall it just in case. But nothing worked....

    So I back traced my application to a point where it was working. I found out I started getting this problem after I Implemented Google Maps api. So I checked everything related to it. Then I came across these in my manifest and remembered someone somewhere saying package name should be all small letters. So I changed these

    uses-permission android:name="myPackageName.permission.MAPSRECEIVE" permission android:name="myPackageName.permission.MAPSRECEIVE" android:protectionLevel="signature" into these: uses-permission android:name="mypackagename.permission.MAPSRECEIVE" permission android:name="mypackagename.permission.MAPSRECEIVE" android:protectionLevel="signature"

    And lo and behold, it worked.

    Hope this helps somebody.

    • Edit: the manifest info wasn't showing up earlier. Removed teh starting and ending < and /> to make them show up.
    Friday, March 18, 2016 5:09 PM
  • User203912 posted

    Build Output: 2>:Deployment failed 2>Mono.AndroidTools.InstallFailedException: Unexpected install output: pkg: /data/local/tmp/com.squadra.login-Signed.apk 2>Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED] 2> 2> at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) 2> at Mono.AndroidTools.AndroidDevice.<InstallPackage>c__AnonStoreyD.<>m__0(Task1 t) 2> at System.Threading.Tasks.ContinuationTaskFromResultTask1.InnerInvoke() 2> at System.Threading.Tasks.Task.Execute() 2>Deployment failed because of an internal error: Unexpected install output: pkg: /data/local/tmp/com.squadra.login-Signed.apk 2>Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED] 2> 2>InternalError 2>Build succeeded. 2>Deploy successfully on Nexus 4 (KitKat) ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========

    I tried your recomendations but I can't resolve it. I'm using the Facebook SDK, could this be the problem?

    Saturday, March 26, 2016 2:49 PM
  • User203912 posted

    Sorry, here's the full output

    Saturday, March 26, 2016 2:52 PM
  • User203065 posted

    I had the same issue when I updated Xamarin from a trial version to a non trial version. I have fixed the issue by uninstalling Xamarin.Android API-19 in my Android phone. Then when Visual Studio deploy the app, the API is installed again with the right version.

    Hope this helps!

    Monday, April 4, 2016 11:19 AM
  • User842 posted

    @Baal_Manche said: I want to reply here because I had the same problem but different solution.

    I am using Visual Studio 2015's Xamarin to develop. I had my solution set to deploy. I had selected both x86 and x64 in my project's Android Options. I did not have my app in the applications list (Emulator Android -> Settings -> Apps). Still I ran shell to uninstall it just in case. But nothing worked....

    So I back traced my application to a point where it was working. I found out I started getting this problem after I Implemented Google Maps api. So I checked everything related to it. Then I came across these in my manifest and remembered someone somewhere saying package name should be all small letters. So I changed these

    uses-permission android:name="myPackageName.permission.MAPSRECEIVE" permission android:name="myPackageName.permission.MAPSRECEIVE" android:protectionLevel="signature" into these: uses-permission android:name="mypackagename.permission.MAPSRECEIVE" permission android:name="mypackagename.permission.MAPSRECEIVE" android:protectionLevel="signature"

    And lo and behold, it worked.

    Hope this helps somebody.

    • Edit: the manifest info wasn't showing up earlier. Removed teh starting and ending < and /> to make them show up.

    That was my issue. I just added Push service and didnt have the correct package name for Android app. Once I updated the package names appropriately, it worked. Thank you!

    Monday, April 4, 2016 3:28 PM
  • User212325 posted

    @efomo said: I had similar problems after updating to Xamarin 4. Neither of the solutions provided above worked for me. In order to fix the debugger I had to downgrade Xamarin to version 3. It can be done here:

    https://store.xamarin.com/account/my/subscription/downloads#xamarin3

    Thanks

    Wednesday, April 6, 2016 3:47 PM
  • User212325 posted

    @efomo said: I had similar problems after updating to Xamarin 4. Neither of the solutions provided above worked for me. In order to fix the debugger I had to downgrade Xamarin to version 3. It can be done here:

    https://store.xamarin.com/account/my/subscription/downloads#xamarin3

    Thanks

    Wednesday, April 6, 2016 3:47 PM
  • User51041 posted

    Deleting /bin & /obj folders and deleting app from device didn't work. PranavSharma's solution of using adb to delete the app worked. Note that the app didn't appear in the list of apps on the phone before adb reported success in deleting it.

    Thursday, April 28, 2016 3:14 PM
  • User199554 posted

    none of the above has solved my issue :( , any real one for this issue

    Sunday, May 1, 2016 5:37 PM
  • User17169 posted

    For me the main reason for this error (The application could not be started. Ensure that the application has been installed to the target device and has a launchable activity (MainLauncher = true).) is due to a apk version of the app being installed on the device already then trying to debug an app with the same application name. Just remove/Un-Install the installed version before debugging.

    Wednesday, May 11, 2016 11:01 AM
  • User65749 posted

    You'll get this problem most likely if you deploy your app from Visual Studio and Xamarin on Mac - you must delete if you deploy across different tools.

    Monday, May 16, 2016 4:06 PM
  • User210162 posted

    @Baal_Manche said: I want to reply here because I had the same problem but different solution.

    I am using Visual Studio 2015's Xamarin to develop. I had my solution set to deploy. I had selected both x86 and x64 in my project's Android Options. I did not have my app in the applications list (Emulator Android -> Settings -> Apps). Still I ran shell to uninstall it just in case. But nothing worked....

    So I back traced my application to a point where it was working. I found out I started getting this problem after I Implemented Google Maps api. So I checked everything related to it. Then I came across these in my manifest and remembered someone somewhere saying package name should be all small letters. So I changed these

    uses-permission android:name="myPackageName.permission.MAPSRECEIVE" permission android:name="myPackageName.permission.MAPSRECEIVE" android:protectionLevel="signature" into these: uses-permission android:name="mypackagename.permission.MAPSRECEIVE" permission android:name="mypackagename.permission.MAPSRECEIVE" android:protectionLevel="signature"

    And lo and behold, it worked.

    Hope this helps somebody.

    • Edit: the manifest info wasn't showing up earlier. Removed teh starting and ending < and /> to make them show up.

    thanks a lot, it worked for me

    Tuesday, May 24, 2016 12:06 PM
  • User229045 posted

    I had the same problem. This is my solution: rename the "Package name". Right click porject and selest "Properties" -> "Andriod Manifest" -> "Package name", rename it. example:
    old "Package name" is "com.xamarin.acquaintforms", new "Package name" is "com.xamarin.acquaintforms.0",
    build and debug, then it worked.

    Friday, May 27, 2016 4:09 PM
  • User229764 posted

    adb uninstall did the trick. The strange thing is that even if you run the command to list all app that are installed it will not show up but if you run the uninstall command with ur package name which should be ur project name or name that you have assigned you will get the success result which means it got uninstalled and to check that if run the uninstall command again with same package name u will get failure command. Then deploying ur package again should work

    Tuesday, May 31, 2016 1:49 AM
  • User220556 posted

    @Baal_Manche said: I want to reply here because I had the same problem but different solution.

    I am using Visual Studio 2015's Xamarin to develop. I had my solution set to deploy. I had selected both x86 and x64 in my project's Android Options. I did not have my app in the applications list (Emulator Android -> Settings -> Apps). Still I ran shell to uninstall it just in case. But nothing worked....

    So I back traced my application to a point where it was working. I found out I started getting this problem after I Implemented Google Maps api. So I checked everything related to it. Then I came across these in my manifest and remembered someone somewhere saying package name should be all small letters. So I changed these

    uses-permission android:name="myPackageName.permission.MAPSRECEIVE" permission android:name="myPackageName.permission.MAPSRECEIVE" android:protectionLevel="signature" into these: uses-permission android:name="mypackagename.permission.MAPSRECEIVE" permission android:name="mypackagename.permission.MAPSRECEIVE" android:protectionLevel="signature"

    And lo and behold, it worked.

    Hope this helps somebody.

    • Edit: the manifest info wasn't showing up earlier. Removed teh starting and ending < and /> to make them show up.

    Thanks :smile:

    Wednesday, June 1, 2016 9:35 PM
  • User232456 posted

    @Baal_Manche said: I want to reply here because I had the same problem but different solution.

    I am using Visual Studio 2015's Xamarin to develop. I had my solution set to deploy. I had selected both x86 and x64 in my project's Android Options. I did not have my app in the applications list (Emulator Android -> Settings -> Apps). Still I ran shell to uninstall it just in case. But nothing worked....

    So I back traced my application to a point where it was working. I found out I started getting this problem after I Implemented Google Maps api. So I checked everything related to it. Then I came across these in my manifest and remembered someone somewhere saying package name should be all small letters. So I changed these

    uses-permission android:name="myPackageName.permission.MAPSRECEIVE" permission android:name="myPackageName.permission.MAPSRECEIVE" android:protectionLevel="signature" into these: uses-permission android:name="mypackagename.permission.MAPSRECEIVE" permission android:name="mypackagename.permission.MAPSRECEIVE" android:protectionLevel="signature"

    And lo and behold, it worked.

    Hope this helps somebody.

    • Edit: the manifest info wasn't showing up earlier. Removed teh starting and ending < and /> to make them show up.

    This worked for me!!! Thanks, it occured after adding GCM push library for notifications

    Tuesday, June 14, 2016 11:36 AM
  • User101859 posted

    Another reason to get this error is this: I defined an Android IntentService and didn't spell the ServiceName in all lowercase. So instead of this: [Service(Name = "Plugin.MyPlugin.MyConfigService", Exported = true, Enabled = true)] I had to do this: [Service(Name = "plugin.myplugin.MyConfigService", Exported = true, Enabled = true)] Hope this helps.

    Tuesday, July 26, 2016 1:06 PM
  • User218515 posted

    I got this error also. I change name of Package name(Android Project -> Properties -> Android Manifest - > Package name) and resolve this problem

    Thursday, August 18, 2016 4:14 PM
  • User246117 posted

    I tried All, in my case the solution was in update the SDK.

    Monday, September 5, 2016 7:00 AM
  • User278712 posted

    Problem with me was I had deleted the apk file from phone disk. I had also uninstalled the application from my phone. The Settings -> Apps -> All tip did the trick, I had the app still there but only not for the CURRENT USER anymore, all I had to do was to use Remove For All Users, the only option of the 3 dots hamburger menu button. Thanks.

    Friday, November 25, 2016 1:22 PM
  • User275839 posted

    @BerayBentesen said: Try deleting /bin & /obj folder from project folder. Also delete apk mono framework from your phone. If you can not fix, return to Xamarin 3 until new update.

    That certainly did it for me. I was developing it on one pc then copied and pasted the project to another PC - it started happening. Cleaning the bin/Debug folder certainly did the trick!

    Thanks for the suggestion. Should have thought of it right away!

    Friday, December 2, 2016 11:37 PM
  • User248390 posted

    @PranavSharma said: This is how I got it to work open adb command prompt type adb uninstall <Your app's package name> Then Clean, Build and Deploy

    This is worked. I previously built and run using the Visual Studio for Mac. Later When I tried with Visual Studio 2015 in Windows 10 it refused to work.

    Those who wonder where to run the uninstall command Tools => Android => Android Adb Command Prompt

    If you are not sure about your package name 1. Right click on your Droid solution and select property 2. Select Android Manifest 3. Check for Package Name

    Sunday, December 11, 2016 2:29 AM
  • User277772 posted

    Uninstalling application or renaming package will do the trick most of the times

    Monday, December 19, 2016 8:34 AM
  • User254084 posted

    For me the reason of the same error was that there was not enough space on the emulator. Some default AVD templates in Android SDK come with miserable internal storage (~300 MB) which gets filled up with cached data and Xamarin Mono Shared Runtime. So make sure to add a gigabyte internal storage when creating / modifying an AVD.

    Wednesday, December 21, 2016 4:18 PM
  • User263132 posted

    I encountered this problem after upgrading to the latest Xamarin yesterday. I followed IvanHarris's suggestion of changing the package name to lowercase (go to Project->Properties->Android Manifest->Package Name). Viola! it worked!

    Friday, December 30, 2016 6:09 PM
  • User193500 posted

    I just had the same issue. It started happening when I started testing Google Play beta distribution. After installing the app from the Google Play store, I then tried to deploy a debug version via Visual Studio, and that's when I got the error. The strange thing was that Visual Studio's deploy attempt removed the app, but I guess not all the way. It didn't show up in Application Manager, so I couldn't cleanly uninstall it that way.

    My solution was to re-install it via Google Play, then uninstall via Google Play. That cleaned it up so that I was then able to deploy it to my phone via Visual Studio and debug it.

    Thursday, January 5, 2017 1:24 AM
  • User289691 posted

    Joseph, could you please explain or link to a procedure on how you reinstalled and uninstalled via Google Play? I'm getting the error in VS 2015 that the application could not be started on target device, but I don't see it in the Application Manager.

    Sunday, January 8, 2017 10:22 PM
  • User289908 posted

    Just wanted to tell you that my solution was to "Wipe User Data" and it worked.

    Working only on emulator.

    Monday, January 9, 2017 12:56 PM
  • User263132 posted

    @PranavSharma said: This is how I got it to work open adb command prompt type adb uninstall <Your app's package name> Then Clean, Build and Deploy

    You are my hero. My app did not even show up on the app list.

    Friday, February 10, 2017 12:10 AM
  • User92953 posted

    I was facing the same issue as below, "The application could not be started. Ensure that the application has been installed to the target device and has a launchable activity (MainLauncher = true)."

    I tried re-installing the app, even rebooted the PC and phone, but no luck. I also tried uninstalling Mono Runtime as well as Xamarin Android Run times in my phone as some of you guys have mentioned here, but still I had no luck.

    So I tried manually uninstalling the app through the ADB console,

    adb -s <your device id> uninstall <your app id>
    

    and voila! it worked! :D hope it helps someone! cheers :)

    Monday, March 6, 2017 4:40 AM
  • User214098 posted

    The solution that worked for me is this: adb uninstall

    Tuesday, August 29, 2017 5:04 AM