플러터 프로젝트를 하다가 다음과 같은 에러가 발생했습니다.
ERROR:C:\Users\user\StudioProjects\~~\android\app\src\main\res\mipmap-hdpi\ic_launcher.png:
AAPT: error: failed to read PNG signature: file does not start with PNG signature.
일단 문제의 핵심 키워드는 ic_launcher.png 이며
이 파일을 읽어들일 수 없다는 것 같습니다.
저도 검색해보니 결론은 "PNG 파일이 아닌데 PNG 파일로 바꿔서"라고 합니다...
??? 이게 무슨 소린가 할 수 있겠지만,
예를 들어 아래 사진처럼 txt 파일을 탐색기에서 png로 강제로 바꾸는 느낌인거죠
물론 txt를 png로 바꾸는건 억지지만..
저는 jpg 파일을 png로 바꿨는데도 그렇더군요.
그래서 탐색기에서 파일명으로 안바꾸고
아래 사이트에서 아예 파일변환을 했더니 제대로 빌드되더라구요.
JPEG 파일을 PNG로
JPG 이미지를 PNG 포맷으로 온라인에서 올바른 압축기법을 사용하여 무료 전환 하세요
jpg2png.com
기분좋게 빌드 완료!
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 1m 2s
142 actionable tasks: 17 executed, 125 up-to-date
Build Analyzer results available
참고로 abb 파일은 [프로젝트 > android > app > release] 경로 안에 "app-release.abb"로 저장되어 있습니다.
댓글