App/Flutter

[ FLUTTER ] launcher icon plugin

최진훈 2022. 2. 3. 16:29

 

https://pub.dev/packages/flutter_launcher_icons

 

flutter_launcher_icons | Dart Package

A package which simplifies the task of updating your Flutter app's launcher icon.

pub.dev

 

1. 플러그인 설치

flutter pub add flutter_launcher_icons

 

2. 설치 후 dependencies 에 있는 flutter_launcher_icons -> dev_dependencies 변경 후 flutter_icons 경로 세팅

dev_dependencies:
    flutter_launcher_icons: ^0.9.0
    
    
flutter_icons:
    android: "launcher_icon"
    ios: true
    image_path: "assets/icon/icon.png"

 

3. flutter pub get 실행 후 플러그인 실행

flutter pub get
flutter pub run flutter_launcher_icons:main

 

4. 플러그인 실행 시 아래 같은 에러 나올 시

Unhandled exception: FormatException: Invalid number (at character 1)

android/app/build.gradle 에서 minSdkVersion 설정

  defaultConfig {
        applicationId "com.example.foo"
        minSdkVersion 16 // <<== set this
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }