发生多个任务操作失败:执行com.android.build.gradle.internal.tasks时出现故障。Workers$ActionFacade〉Android资源编译失败AAPT:D:\抖音项目\游戏大师\安卓\app\src\main\res\mipmap-hdpi\ic_launcher.png:错误:无法读取PNG签名:文件未以PNG签名开头。D:\Flutter Projects\阅读大师\android\app\src\main\res\mipmap-hdpi\ic_launcher.png:错误:文件无法编译。
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
AAPT: D:\Flutter Projects\Areading-master\android\app\src\main\res\mipmap-xhdpi\ic_launcher.png: error: failed to read PNG signature: file does not start with PNG signature.
D:\Flutter Projects\Areading-master\android\app\src\main\res\mipmap-xhdpi\ic_launcher.png: error: file failed to compile.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
AAPT: D:\Flutter Projects\Areading-master\android\app\src\main\res\mipmap-xxhdpi\ic_launcher.png: error: failed to read PNG signature: file does not start with PNG signature.
D:\Flutter Projects\Areading-master\android\app\src\main\res\mipmap-xxhdpi\ic_launcher.png: error: file failed to compile.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
AAPT: D:\Flutter Projects\Areading-master\android\app\src\main\res\mipmap-xxxhdpi\ic_launcher.png: error: failed to read PNG signature: file does not start with PNG signature.
D:\Flutter Projects\Areading-master\android\app\src\main\res\mipmap-xxxhdpi\ic_launcher.png: error: file failed to compile.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
AAPT: D:\Flutter Projects\Areading-master\android\app\src\main\res\mipmap-mdpi\ic_launcher.png: error: failed to read PNG signature: file does not start with PNG signature.
D:\Flutter Projects\Areading-master\android\app\src\main\res\mipmap-mdpi\ic_launcher.png: error: file failed to compile.
当我尝试通过**flutter build apk --split-per-abi**
命令构建项目时发生此错误。我不知道这是怎么回事?请帮助。
2条答案
按热度按时间eanckbw91#
构建器会优化应用中的图像,在本例中为png图像。这是为了减小apk的大小。但在您的情况下无法实现这一点。要在不进行优化的情况下运行,您可以将以下内容放入build.gradle
iszxjhcz2#
我在res/drawable中将.png文件更改为.jpg,它对我很有效