簡體   English   中英

無法使用 Flutter 啟動器圖標更改 iOS 中的應用程序圖標

[英]Not being able to change the app icon in iOS using flutter launcher icon

我試圖從“https://pub.dev/packages/flutter_launcher_icons”包中更改應用程序圖標。 我按照網站上寫的步驟操作,它似乎確實將所需的圖標添加到了 xcode 中。 然而,圖標在構建時就像崩潰了。 我開始意識到在 xcode 中,在資產中,必須檢查目標成員資格。 所以我確實在目標成員資格中添加了復選標記。 這次它確實讀取了 xcode 中的圖標。

但我又犯了一個錯誤,這次說如下,

    error: Multiple commands produce '....../build/ios/Debug-dev-iphonesimulator/Runner.app/Assets.car':
    1) Target 'Runner' (project 'Runner') has compile command with input '...../ios/Runner/Assets.xcassets'
    2) That command depends on command in Target 'Runner' (project 'Runner'): script phase “[CP] Copy Pods Resources”

我嘗試了以下站點中編寫的內容,但沒有結果。

https://dev.to/kylefoo/xcode-12-new-build-system-warns-multiple-commands-produce-assets-car-56im

所以有人可以幫我嗎?

使用包: flutter_launcher_icons

  1. 設置配置文件將您的 Flutter Launcher Icons 配置添加到您的pubspec.yaml

     dev_dependencies: flutter_launcher_icons: "^0.9.2" flutter_icons: android: "launcher_icon" ios: true image_path: "assets/icon/icon.png"
  2. 在終端中運行以下命令:

     flutter pub get flutter pub run flutter_launcher_icons:main -f pubspec.yaml
  3. 運行包
    設置好配置后,剩下要做的就是運行包。

     flutter pub get flutter pub run flutter_launcher_icons:main

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM