To change the app icon in Flutter without using a package, follow these steps:
-
Step 1: Create or design the app icon and ensure it is available in the required sizes for both Android and iOS platforms.
-
Step 2 (For Android):
- Open your Flutter project in your preferred IDE.
Navigate to
android/app/src/main/res``, where you'll find multiple
mipmap-* folders (e.g., mipmap-hdpi
,mipmap-xhdpi
). Replace the default icons in these folders with your custom icons, ensuring the correct sizes match the folders’ requirements. Update theandroid:icon
attribute in theAndroidManifest.xml
file to reference the new icon.
- Open your Flutter project in your preferred IDE.
Navigate to
-
Step 3 (For iOS):
- Navigate to the
ios/Runner/Assets.xcassets
folder. Replace the existing app icon set with your custom icons, ensuring you include all required sizes for iPhones, iPads, and the App Store. Update theInfo.plist
file if necessary to ensure the new icons are correctly referenced.
- Navigate to the
-
Step 4: After updating the icons, run the app on both Android and iOS simulators or devices to ensure the custom app icon is displayed correctly. Perform a clean build using flutter clean and then run the app again to ensure all changes are applied properly.