관리 메뉴

Bull

[Flutter::trubleshooting] flutter_launcher_icons black background trubleshooting (android) 본문

Software Framework/Flutter

[Flutter::trubleshooting] flutter_launcher_icons black background trubleshooting (android)

Bull_ 2024. 9. 29. 13:01

해결방법


flutter_launcher_icons:
  ios: true
  android: true
  remove_alpha_ios: true
  image_path: "assets/icon/icon.png" 
  adaptive_icon_background: "#ffffff" 
  adaptive_icon_foreground: "assets/icon/icon.png"

원래는 image_path 까지만 적어줬었는데 혹시나 adaptive_icon_background ,adaptive_icon_foreground 까지 적어주니까 적용됐다. 원래는 필요없는 줄 알았는데...


생성된 mipmap 파일들을 보니까 foreground 로 생성되었다. 적응형이 기본으로 들어가서 그런지 mipmap-anydpi-v26 폴더 아래 파일 설정을 보면 foreground 옵션으로 생성되는 거 같다.

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
  <background android:drawable="@color/ic_launcher_background"/>
  <foreground>
      <inset
          android:drawable="@drawable/ic_launcher_foreground"
          android:inset="16%" />
  </foreground>
</adaptive-icon>

해결했었던 방법들


  • 배경 투명도가 없어도 안됨.
  • AndroidManifest.xml 파일에 android:icon="@mipmap/ic_launcher" 설정도 잘해놨는데 안됨.
  • mipmap-anydpi-v26 파일 수작업으로 고쳐도 안됨.