Xamarin无法启动应用程序

时间:2017-02-14 11:38:41

标签: 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).

我做的事情:

  • adb uninstall;没有任何反应
  • 尝试从设备上卸载应用程序:应用程序没有apeard,即使像0kb的假应用程序
  • 从应用
  • 卸载Mono Shared Runtine和Api
  • 恢复出厂设置
  • 检入其他设备

没有什么可以解决我的问题,我不知道我该做什么。

添加:

我的主要活动;

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

3 个答案:

答案 0 :(得分:2)

我发现错误(最后)我的应用包名称启动whit upercase

AppTecnicos.Droid

我将其更改为:

appTecnicos.Droid

答案 1 :(得分:1)

  

无法启动应用程序。确保...具有可启动活动(MainLauncher = true)。

您的应用中的一个Activity需要被指定为MainLauncher,否则Android操作系统不知道应用的主要入口点和要显示的内容。

Xamarin.Android中,通常会通过ActivityAttribute分配MainLauncher = true来完成此操作。

示例:

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

参考:ActivityAttribute Class

答案 2 :(得分:0)

如果您正在使用visual studio并且您的应用程序是Xamarin.Forms应用程序,则可能由于解决方案配置问题而发生这种情况。

在这种情况下,尝试打开解决方案属性,然后在配置属性部分中检查您的proyect是否已检查部署。

相关问题