简体   繁体   English

Android应用程式会编译并安装,但不会显示在我的应用程式中

[英]Android app compiles and installs, but won't show up in my apps

Has anyone seen an issue where you can export your app to an .apk file and you can install it and everything looks ok but the app never shows up in the list of installed applications. 有没有人见过一个问题,您可以将应用程序导出到.apk文件,然后进行安装,一切正常,但该应用程序永远不会显示在已安装的应用程序列表中。 I have another app that installed and is running fine. 我有另一个已安装且运行良好的应用程序。 Totally stumped by what I could be doing wrong... I think it's signed correctly (I've tested the key on the working app... am I missing something really stupid?) 完全被我可能做错的事情所困扰...我认为它已正确签名(我已经测试了工作应用程序上的密钥...我缺少真正愚蠢的东西吗?)

EDIT I'm editing to add the solution. 编辑我正在编辑以添加解决方案。 Android requires that the main Activity be called MAIN in the manifest. Android要求清单中的主Activity称为MAIN。 You can call your class anything you want but the XML has to include this: 您可以随意调用类,但XML必须包含以下内容:

<intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

Not realizing this, I had named mine something else and rather than just failing outright, it worked perfectly in the emulator, but failed to open on the phone. 没意识到这一点,我给我起了别的名字,而不仅仅是彻底失败,它在仿真器中可以完美运行,但无法在手机上打开。

You'll need to create an activity with android.intent.action.MAIN with android.intent.category.LAUNCHER, kind of like this: 您需要使用android.intent.category.LAUNCHER和android.intent.action.MAIN创建一个活动,如下所示:

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

For more information, see here: http://developer.android.com/guide/topics/manifest/manifest-intro.html (under Icons and Labels). 有关更多信息,请参见此处: http : //developer.android.com/guide/topics/manifest/manifest-intro.html (在“图标和标签”下)。

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

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