flutteradaptive-icon

Can I use Android 8.0 Adaptive Icons for a Flutter app?


How can I use an Adaptive Icon for my Flutter app on Android 8.0 and up? The Create Image Asset dialog in Android Studio says "Project must be built with SDK 26 or later to use adaptive icons", even though my android build.gradle has CompileSDKVersion set to 27. If I define the icon in XML, it doesn't work, it seems to just use the regular legacy app icon.


Solution

  • They work perfectly fine.

    Solution

    To work with the dialog, you will need to open your Android module in Android Studio.
    Flutter.dev article

    Navigation is the following in the menu bar: Tools ~> Flutter ~> Open Android module in Android Studio or right-click anywhere in your android folder in the project view and select Flutter ~> Open Android module in Android Studio.

    Now you will be able to use the asset dialog normally.

    If it still does not work (this does not happen)

    If your dialog does not work in your Flutter project, you can easily create an adaptive icon in an Android project and then copy the necessary file, which are:

    This would cover everything for me. Now, in your AndroidManifest.xml specify android:icon="@mipmap/ic_launcher" for your application, i.e. in your <application> tag, and if needed android:roundIcon:"@mipmap/ic_launcher_round".