Xamarin - Android - Visual Studio - The applicatio

2019-01-17 20:14发布

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.

14条回答
倾城 Initia
2楼-- · 2019-01-17 20:48

I've managed to solve it by wiping user data from emulator.

From AVD Manager, when you start the emulator, check "Wipe user data" and your emulated device will behave like new.

Problem itself appeared after updating to Android SDK Tools 25.1.3.

查看更多
放我归山
3楼-- · 2019-01-17 20:49

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.

查看更多
三岁会撩人
4楼-- · 2019-01-17 20:54

Renaming Application Name and Package Name (go to Manifest settings) where helped to resolve this issue

查看更多
Evening l夕情丶
5楼-- · 2019-01-17 20:54

The only alternatives which help me solve this were the following:

  • From the Xamarin Android Studio home page (where all devices are displayed), click on the "three-dots" button and then Factory Reset.

OR

  • Install a new device and deploy your app there.
查看更多
6楼-- · 2019-01-17 20:56

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.

查看更多
兄弟一词,经得起流年.
7楼-- · 2019-01-17 20:56

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.

查看更多
登录 后发表回答