Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 为什么我的应用程序在安装后没有显示在图标网格(而不是启动器)中_Android_React Native - Fatal编程技术网

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

Android 为什么我的应用程序在安装后没有显示在图标网格(而不是启动器)中,android,react-native,Android,React Native,我最近开始测试我的react原生android应用程序,并注意到它在安装时不会创建应用程序图标。当我调试时-它似乎安装和运行良好,但当我在应用程序图标中查找它以启动时-它不会显示。查看已安装应用程序的列表,它就在那里。我如何调试这个?我是否需要将启动模式从singleTop更改为其他模式?我尝试将其更改为singleInstance,但仍然存在相同的问题。如果我删除了一些intent过滤器,它似乎可以工作——所以我可能把branch.io的安装说明弄糟了?我是否需要为其他意图创建单独的意图过滤器

我最近开始测试我的react原生android应用程序,并注意到它在安装时不会创建应用程序图标。当我调试时-它似乎安装和运行良好,但当我在应用程序图标中查找它以启动时-它不会显示。查看已安装应用程序的列表,它就在那里。我如何调试这个?我是否需要将启动模式从
singleTop
更改为其他模式?我尝试将其更改为
singleInstance
,但仍然存在相同的问题。如果我删除了一些intent过滤器,它似乎可以工作——所以我可能把branch.io的安装说明弄糟了?我是否需要为其他意图创建单独的意图过滤器xml节点

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>
            <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>

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

您不需要进入设置->应用程序,只需查看即可。这就是你的问题吗

也许屏幕截图和测试设备的描述会让问题更清楚

更新

通常,启动活动有一个仅包含MAIN和LAUNCHER的意图过滤器。我将尝试从意图过滤器中删除其他内容,看看这是否解决了问题。然后一个接一个地添加列出的其他内容,直到您确定问题儿童


再看一遍,我不确定您是否可以在单个事件筛选器中定义两个操作。因此,您似乎需要删除视图。

对不起,我说错了,不是启动器,而是应用程序列表。应用程序图标在手机上除了“设置”->“应用程序”之外,没有其他位置。是的,这就是我看到的问题。这似乎与我为支持branch.io而添加的意图过滤器有关好的,我将意图过滤器从branch.io指令移动到了一个新的意图过滤器-不确定这是否正确,但这似乎已经修复了它。