简体   繁体   English

Android App开发和monodevelop中的错误

[英]Android App developement and Error in monodevelop

I have written a hello world app in monodevelop(version 3.05) and trying to run it on emulator. 我已经在monodevelop(版本3.05)中编写了一个hello world应用程序,并试图在模拟器上运行它。 Program is compiled successfully but when I try to Run it it gives following error. 程序已成功编译,但是当我尝试运行它时,出现以下错误。

   Detecting installed packages


   Installing shared runtime


   Deployment failed. Internal error

I have installed all prerequisites. 我已经安装了所有先决条件。

    1. mono for Android
     2. mono framework
      3. gtk#
       4. Android SDK

我通过SDK Manager安装所有软件包

Following is code. 以下是代码。

 using System;

  using Android.App;
  using Android.Content;
  using Android.Runtime;
  using Android.Views;
  using Android.Widget;
  using Android.OS;

   namespace  myAndroid
    {
[Activity (Label = "myAndroid", MainLauncher = true)]
public class Activity1 : Activity
{
    int count = 1;

    protected override void OnCreate (Bundle bundle)
    {
        base.OnCreate (bundle);

        // Set our view from the "main" layout resource
        SetContentView (Resource.Layout.Main);

        // Get our button from the layout resource,
        // and attach an event to it
        Button button = FindViewById<Button> (Resource.Id.myButton);

        button.Click += delegate {
            button.Text = string.Format ("{0} clicks!", count++);
        };
    }
    }
         }

Edit: .Net 2.0 .Net 4.0 visual studio 2010 express are already installed on my computer. 编辑:.Net 2.0 .Net 4.0 visual studio 2010 Express已安装在我的计算机上。 I run visual studio 2005 as administrator on windows 7 but monodevelop does not give me this option to run as administrator if this a problem related to permission rights. 我在Windows 7上以管理员身份运行Visual Studio 2005,但如果这是与权限相关的问题,monodevelop并没有为我提供以管理员身份运行的选项。

I have seen this in VS2010 and VS2012 as well and the main reason for this is, when the the project is not set to deploy in the Solution properties. 我在VS2010和VS2012中也看到了这一点,其主要原因是,当项目未设置为在解决方案属性中部署时。

解决方案的属性窗口

If that deploy flag is removed you will run into that issue. 如果该部署标记被删除,您将遇到该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM