简体   繁体   中英

Why I am getting app icon error while build IOS flutter app?

While I am debugging flutter IOS app with real device, I always get " The app icon set "AppIcon" has 46 unassigned children ". I have been added app icons in the ios> Runner>Assets.xcassets>AppIcon.appiconset.But build failed in xcode. How to fix it.

I described with screen shoots of my project specifications.

这是我得到的错误

为 iPhone、iPad、CarPlay、Mac、Apple Watch 选择

  1. You must open your iOS folder to Xcode:

在此处输入图像描述

  1. goto https://appicon.co/ and drag your icon and generate assets icons:

在此处输入图像描述

  1. after download AppIcon.zip you must unzip and drag or copy and paste to the directory:

在此处输入图像描述 在此处输入图像描述

  1. paste it to the directory in below picture:

在此处输入图像描述

You can use package so it will take care of all this issue.

  1. please add this dependency on your pubspec.yaml page

    dev_dependencies: flutter_test: sdk: flutter flutter_launcher_icons: ^0.7.4

  2. you have to upload an image/icon on your project which you want to see as a launcher icon. (i have created a folder name:image in my project then upload the logo.png in the image folder). Now you have to add the below codes and paste your image path on image_path: in pubspec.yaml page.

    flutter_icons: image_path: "images/logo.png" android: true ios: true

  3. Go to terminal and execute this command:

    flutter pub get

  4. After executing the command then enter below command:

    flutter pub run flutter_launcher_icons:main

  5. Done

I can run on either IOS simulator or physical device. Step -> Delete LauchScreen folder and Asset Catalog Launch name remove in build setting. Then I got it. 在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM