1-问题描述:导入项目执行built时出现:Error:Failed to open zip file
Error:Failed to open zip file.
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
Re-download dependencies and sync project (requires network)
解决办法:
将系统用户目录下的.gradle文件夹删除(如我的是在:C:\Users\Administrator\.gradle),重启Android Stuido后,会重新下载对应的gradle,问题解决.
2-问题描述:AAPT err(Facade for 370671127): libpng error: Not a PNG file Error:Execution failed for task ':app:mergeDebugResources'
解决办法:
在该项目的built.gradle文件中添加
aaptOptions{
cruncherEnabled = false
}
本文介绍了两种常见的Android项目构建失败的问题及其解决方案。一是因Gradle依赖缓存损坏导致的“Failed to open zip file”错误;二是由于资源文件解析问题引发的“libpng error: Not a PNG file”错误。
3226

被折叠的 条评论
为什么被折叠?



