Flutter:添加自定义应用图标会产生很多错误

时间:2019-09-12 21:11:19

标签: android xml flutter dart dependencies

因此,我完成了这个小应用程序原型,并想添加一个自定义图标,因此我添加了依赖项并将我的图标作为资产放置,所有操作均根据this tutorial。在我将其推送到GitHub之前,它似乎运行良好,并且表明我有很多Android和XML错误。

Android错误:

enter image description here

XML错误:

enter image description here

就像我说的,我所做的只是将图标作为资产并运行:

flutter pub get
flutter pub run flutter_launcher_icons:main -f <your config file name here>

我不想重载代码,但这是.xml之一,它会产生错误:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.news_app">

    <!-- io.flutter.app.FlutterApplication is an android.app.Application that
         calls FlutterMain.startInitialization(this); in its onCreate method.
         In most cases you can leave this as-is, but you if you want to provide
         additional functionality it is fine to subclass or reimplement
         FlutterApplication and put your custom class here. -->
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="news_app"
        android:icon="@mipmap/launcher_icon">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            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>
</manifest>

我只是很困惑,一件小事怎么可能破坏一个完美的程序,而我却不知道如何恢复。有任何想法吗?谢谢。

0 个答案:

没有答案