我正在开发一个简单的颤振应用程序,想更改启动器中图标下显示的名称。据我所知,这应该通过更改在 Android 上完成
android:label
属性在安卓清单中.xml
唯一的问题是更改它没有任何效果。我的应用程序名称仍然是项目名称(例如test_app(。
我尝试直接在字段中输入名称,并在/android/app/src/main/res/values 中创建另一个 xml 文件并从那里读取名称。喜欢这个:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">My awesome app</string>
</resources>
并在安卓清单中.xml
android:label="@string/app_name"
这无济于事。
以下是我的 AndroidManifest 中应用程序标记之间的所有内容.xml此时:
<application
android:name="io.flutter.app.FlutterApplication"
android:label="My awesome app"
android:icon="@mipmap/ic_launcher">
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"></action>
</intent-filter>
</receiver>
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
此外,package_info库给出了原始工作名称(例如test_app(,而不是我在 android:label 中指定的名称。
这在调试时应该工作吗?
我错过了一些基本的东西吗?谢谢!
因此,显然在发布模式下运行该应用程序可以解决问题。不知道为什么,但可能有一个很好的理由。