我已经使用Flutter创建了默认的(counter)应用程序,并且它在显示为应用程序列表中的图标方面完美运行,就像任何其他普通应用程序一样。然而,当我继续添加文件,例如插件和Firebase等之后,我重新构建它,应用程序启动了,但应用程序图标没有显示在手机的应用程序列表中。 现在我想知道这是Flutter SDK上的错误还是其他原因导致的。因为以前我使用的是Flutter版本2.2.2,现在我使用的是Flutter 2.5.0。
我已经使用Flutter创建了默认的(counter)应用程序,并且它在显示为应用程序列表中的图标方面完美运行,就像任何其他普通应用程序一样。然而,当我继续添加文件,例如插件和Firebase等之后,我重新构建它,应用程序启动了,但应用程序图标没有显示在手机的应用程序列表中。 现在我想知道这是Flutter SDK上的错误还是其他原因导致的。因为以前我使用的是Flutter版本2.2.2,现在我使用的是Flutter 2.5.0。
<category android:name="android.intent.category.LAUNCHER"/>
然而,我有一些标签覆盖了这个标签,这就破坏了应用程序抽屉的可见性。现在,我的意图过滤器如下所示,并且一切都正常工作:
<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="my.test.app" /> -->
</intent-filter>
<intent-filter>
,它同时结合了从主屏幕(launcher)启动和通过自定义URL方案访问的意图。<intent-filter>
中。Android可能会将此意图过滤器解释为仅用于处理自定义URL方案,而不是一个应该出现在主屏幕上的应用程序。<intent-filter>
中。以下是如何操作:<activity ...>
<!-- Intent filter for launching the app from the launcher -->
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<!-- Intent filter for handling the custom URL scheme -->
<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="appname" />
</intent-filter>
</activity>