[英]Android App developement and Error in monodevelop
我已經在monodevelop(版本3.05)中編寫了一個hello world應用程序,並試圖在模擬器上運行它。 程序已成功編譯,但是當我嘗試運行它時,出現以下錯誤。
Detecting installed packages
Installing shared runtime
Deployment failed. Internal error
我已經安裝了所有先決條件。
1. mono for Android
2. mono framework
3. gtk#
4. Android SDK
以下是代碼。
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++);
};
}
}
}
編輯:.Net 2.0 .Net 4.0 visual studio 2010 Express已安裝在我的計算機上。 我在Windows 7上以管理員身份運行Visual Studio 2005,但如果這是與權限相關的問題,monodevelop並沒有為我提供以管理員身份運行的選項。
我在VS2010和VS2012中也看到了這一點,其主要原因是,當項目未設置為在解決方案屬性中部署時。
如果該部署標記被刪除,您將遇到該問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.