安装后为什么我的应用程序没有显示在图标网格中(而不是启动器)

时间:2017-05-20 13:40:10

标签: android react-native

我最近开始测试我的react-native android应用程序,并注意到它在安装时没有创建应用程序图标。当我调试时 - 它似乎安装并运行正常,但当我在应用程序图标中查找它以启动时 - 它不会显示。查看已安装的应用程序列表,它就在那里。我该怎么调试呢?我是否需要将启动模式从singleTop更改为其他内容?我尝试将其更改为singleInstance,但问题仍然存在。如果我删除一些意图过滤器似乎工作 - 所以也许我搞砸了branch.io安装说明?我是否需要为其他意图创建一个单独的intent filter xml节点? https://dev.branch.io/getting-started/sdk-integration-guide/guide/react/#android-configure-manifest

的AndroidManifest.xml

   <application
      android:name=".MainApplication"
      android:allowBackup="true"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:launchMode="singleTop"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="http"
                  android:host="www.foo.com"
                  android:pathPrefix="/event" />
            <!-- note that the leading "/" is required for pathPrefix-->
            <data android:scheme="fooapp" android:host="open" />
        </intent-filter>
        <intent-filter>
          <action android:name="fcm.ACTION.EVENT" />
          <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
      </activity>

更新

拆分意图过滤器似乎已经解决了 - 但有点不清楚这是否是正确的做法。在branch.io说明中 - 它们是否意味着我创建一个新的intent-filter而不是添加到现有的主要过滤器?

         <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
         </intent-filter>
         <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="http"
                  android:host="www.foo.com"
                  android:pathPrefix="/event" />
            <!-- note that the leading "/" is required for pathPrefix-->
            <data android:scheme="fooapp" android:host="open" />
        </intent-filter>

1 个答案:

答案 0 :(得分:0)

启动器通常是由各个硬件制造商开发的特定软件。在我拥有的所有设备上,如果未从Play商店安装应用程序,则不会在主屏幕上安装该应用程序,但它确实显示在应用程序列表中。但是,这种行为将特定于您正在使用的启动器。

您不需要去设置 - >应用,只是为了看到它。这是你遇到的问题吗?

也许屏幕截图以及对测试设备的描述会使问题更加清晰。

...更新

通常,启动活动只有一个只有MAIN和LAUNCHER的intent过滤器。我只是尝试从该意图过滤器中删除其他内容,看看是否能解决问题。然后逐一添加您列出的其他内容,直到找到问题孩子为止。

再次看一下,我不确定您是否可以在单个事件过滤器中定义2个操作。所以你似乎需要删除VIEW。