2017-02-14 180 views
0

嗨每個人我有一個是煩人的問題:Xamarin應用程序無法啓動

The application could not be started. Ensure that the application has been installed to the target device and has a launchable activity (MainLauncher = true). 

東西我:

  • 亞行卸載;什麼也沒有發生
  • 嘗試UNINSTAL應用從設備:應用程序不apeard,甚至像一個虛假的應用蒙山0KB
  • 卸載單共享Runtine和API的應用程序
  • 出廠設置
  • 入住在其他設備

沒有解決我的問題,我不知道我必須做什麼。

Add:

My MainActivity;

[Activity(Label = "AppTecnicos", Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 

回答

2

我發現錯誤(最後)我的應用程序包的名稱開始白衣大寫在前

AppTecnicos.Droid 

我將其更改爲:

appTecnicos.Droid 
1

應用程序無法啓動。確保...有一個可啓動活動(MainLauncher = true)。需要被指定爲MainLauncher

一個Activity在您的應用程序,否則Android操作系統不知道主入口點的應用程序和顯示什麼。

Xamarin.Android通常這是通過ActivityAttribute指定MainLauncher = true完成的。

例子:

[Activity(Label = "StackOverflow", MainLauncher = true, Icon = "@mipmap/icon")] 
public class MainActivity : AppCompatActivity 
{ 
    ~~~ 
} 

編號:ActivityAttribute Class

+0

他們得到了MainLaucher = true – Efeyabel

0

如果您使用visual studio,並且您的應用程序是Xamarin.Forms應用程序,則可能由於解決方案配置問題而發生此情況。

在這種情況下,嘗試打開解決方案屬性並在配置屬性部分中檢查您的項目是否已檢查部署。