I'm developping an Android app in Visual Studio 2010 with MonoDroid. I'm already pretty far and was able to run and debug my app on the emulator aswell as a Android device. For some reason my Visual Studio is not debugging the app properly to my device anymore. The error i (sometimes) get is:
The application could not be started. Ensure that the application has been installed to the target device and has a launchable activity (MainLauncher = true).
(ALL of the solutions above I've already checked..)
Other times there is no error at all and Visual Studio just stops running or the app starts fine but visual studio is non responsive.
The error just started recently while (almost) nothing has changed on the application. I was hoping someone had this error before and knew if it was because of some property setting or something?
PS: I also believe it could be caused by my camera, I use it in my app and when my app decides to deploy (~1 in 5 times) it crashed on the camera screen, here's the cameracode:
private void CreateCamera(ISurfaceHolder holder)
{
try
{
if (holder != null)
{
camera = Android.Hardware.Camera.Open();
Android.Hardware.Camera.Parameters p = camera.GetParameters();
p.PictureFormat = ImageFormatType.Jpeg;
camera.SetParameters(p);
camera.SetDisplayOrientation(90);
camera.SetPreviewCallback(this);
camera.Lock();
camera.SetPreviewDisplay(holder);
camera.StartPreview();
if (PackageManager.HasSystemFeature("android.hardware.camera.autofocus"))
{
camera.AutoFocus(this);
}
}
}
catch (System.Exception e)
{
Android.Util.Log.Debug("SIMPLECAMERA", e.Message);
System.Console.WriteLine(e.Message);
}
}
In Visual Studio 2010: Build -> Configuration Manager -> Put a check in the "Deploy" box.
This happened to me when I changed from Debug configuration to Release. For some reason, the Deploy box remained unselected.
For me, I had the Deploy checkbox ticked all along but found the trick if you're targeting "Any CPU" for emulators is to explicitly target x86.
I'm running a 32 bit PC and the x86 platform setting is in the Configuration Manager:
First time you run the app it takes a few minutes (to install platform framework and etc).
Edit: I just found the official documentation, some issue with ARM based architecture and x86 being the way to go
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With