앱을 배포하기 위해 아카이빙을 진행하는 도중 xcode 에서 에러가 발생했다.

 

CFBundleIconFiles is not of the required type for that key 해결방법

 

flutter clean? flutter build ios? 다 필요없다.

 

xcode에서 info.plist 오픈.

 

info.plist를 IDE에서 열지 말고 directory단에서 텍스트 편집기로 열 것!!

 

1.

CFBundleIconFiles 검색해서 하단 <String></String> 태그까지 싹 삭제

 

2. 

info.plist 저장한 뒤 다시 Archive.

이 때, 프로젝트를 한번이라도 실행시킬 경우 다시 키 값이 생성되므로 주의!

 

이러면 해결된다.

 

 

 

에러코드:

E/MethodChannel#.com/flutter/local_notifications( 7674): Failed to handle method call
E/MethodChannel#.com/flutter/local_notifications( 7674): java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
E/MethodChannel#.com/flutter/local_notifications( 7674):  at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.setSmallIcon(FlutterLocalNotificationsPlugin.java:76)
E/MethodChannel#.com/flutter/local_notifications( 7674):  at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.createNotification(FlutterLocalNotificationsPlugin.java:88)

 

flutter app android error 

FlutterLocalNotificationsPlugin.setSmallIcon

 

안드로이드에서 FlutterLocalNotificationsPlugin을 통해 내부 알림을 보낼 때 나타나는 icon 설정이 잘못되어있기 때문에 이미지를 찾을 수 없어 알림이 안 나오는 에러!

 

따라서 icon 이미지만 지정해주면 해결된다:

 

FlutterLocalNotificationsPlugin().show(
  notification.hashCode,
  notification.title,
  notification.body,
  const NotificationDetails(
    android: AndroidNotificationDetails(
      'high_importance_channel',
      'High Importance Notifications',
      importance: Importance.max,
      playSound: true,
      enableVibration: true,
      icon: "mipmap/app_icon", //당신의 mipmap 폴더에 있는 보여주려는 아이콘 파일명 입력. 확장자 필요없음
    ),
    iOS: DarwinNotificationDetails(
      presentAlert: true,
      presentBadge: true,
      presentSound: true,
      presentBanner: true,
    ),
  ),
);

 

flutter No file or variants found for asset  에러

플러터에서 이미지 로딩이 안 될 경우

 

flutter:
  assets:
    - assets/images/

 

 

pubspec.yaml 파일에 assets 폴더를 인식할 수 있도록 작성.

그 때 모든 이미지 파일을 나열해서 작성하지 않고 그냥 이미지 폴더까지 등록해도 인식 가능

 

위와 같이 수정 후,

프로젝트 디렉토리에서 flutter clean 해준다.

 

만약 ios도 함께 개발중이라면 project directory 에서 flutter clean 완료된 후 flutter build ios도 실행

% flutter clean 
% flutter build ios

+ Recent posts