0

I have a flutter app that i am testing out on my android phone. The app icon seems to not be recognised. I am getting the default android "alien head" icon for my app and i can't find out why.

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.my.package">
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.VIBRATE"/>

    <queries>
        <!-- If your app opens https URLs -->
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="https" />
        </intent>
        <intent>
            <action android:name="android.intent.action.SENDTO" />
            <data android:scheme="mailto" />
        </intent>
    </queries>
   <application
           android:requestLegacyExternalStorage="true"
        android:label="Charades"
        android:name="${applicationName}"
        android:logo="@mipmap/ic_round"
        android:roundIcon="@mipmap/ic_round"
        android:icon="@mipmap/ic_round">
        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <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.OPEN_DOCUMENT" />
                <category android:name="android.intent.category.OPENABLE" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="*/*" />
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

build.gradle

    defaultConfig {
        minSdkVersion 26
        targetSdkVersion 33

src/main/res/mipmap-anydpi-v26/ic_round.xml:

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:color="@android:color/white"/>
    <foreground android:drawable="@drawable/icon_foreground" />
    <monochrome android:drawable="@drawable/icon_foreground_monochrome" />
</adaptive-icon>

/res/drawable/icon_foreground.xml and /res/drawable-v24/icon_foreground.xml

<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="108dp"
        android:height="108dp"
        android:viewportWidth="108"
        android:viewportHeight="108">
        <path
                android:name="path"
                android:pathData="M 45.2 27.6 C ... rest of path ... Z"
                android:fillColor="#000000"
                android:strokeWidth="1"/>
</vector>

/res/drawable/icon_foreground_monochrome.xml and /res/drawable-v24/icon_foreground_monochrome.xml

<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="108dp"
        android:height="108dp"
        android:viewportWidth="108"
        android:viewportHeight="108">
        <path
                android:name="path"
                android:pathData="M 45.2 27.6 C ... rest of path ... Z"
                android:strokeWidth="1"/>
</vector>
mangusbrother
  • 3,988
  • 11
  • 51
  • 103

0 Answers0