我正在使用gradle 2.1.2,使用sdk版本23编译并构建工具版本23.0.3。
我的项目正在正确编译,但在添加了一个可绘制资源(png文件)之后,我得到了以下消息:
信息:Gradle任务[:app:incrementalDebugSupportDex] :app:buildInfoDebugLoader:app:preBuild UP-TO-DATE:app:preDebugBuild 最新消息:app:checkDebugManifest:app:preReleaseBuild UP-TO-DATE :volley:preBuild UP-TO-DATE:volley:preReleaseBuild UP-TO-DATE :volley:compileReleaseNdk UP-TO-DATE:volley:compileLint :volley:copyReleaseLint UP-TO-DATE:volley:mergeReleaseProguardFiles UP-TO-DATE:凌空:packageReleaseRenderscript UP-TO-DATE :volley:checkReleaseManifest:volley:prepareReleaseDependencies :volley:compileReleaseRenderscript UP-TO-DATE :volley:generateReleaseResValues UP-TO-DATE :volley:generateReleaseResources UP-TO-DATE :volley:packageReleaseResources UP-TO-DATE:volley:compileReleaseAidl UP-TO-DATE:凌空:generateReleaseBuildConfig UP-TO-DATE :volley:mergeReleaseShaders UP-TO-DATE:volley:compileReleaseShaders UP-TO-DATE:凌空:generateReleaseAssets UP-TO-DATE :volley:mergeReleaseAssets UP-TO-DATE:volley:processReleaseManifest UP-TO-DATE:凌空:processReleaseResources UP-TO-DATE :volley:generateReleaseSources UP-TO-DATE :volley:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE :volley:compileReleaseJavaWithJavac UP-TO-DATE :volley:processReleaseJavaRes UP-TO-DATE :volley:transformResourcesWithMergeJavaResForRelease UP-TO-DATE :凌空:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE:凌空:mergeReleaseJniLibFolders UP-TO-DATE :volley:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE :volley:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE :volley:bundleRelease UP-TO-DATE :应用:prepareComAndroidSupportAnimatedVectorDrawable2340Library 最新消息:app:prepareComAndroidSupportAppcompatV72340Library 最新消息:app:prepareComAndroidSupportCardviewV72340Library 最新消息:app:prepareComAndroidSupportCustomtabs2340Library 最新消息:app:prepareComAndroidSupportSupportV42340Library 最新 :应用:prepareComAndroidSupportSupportVectorDrawable2340Library 最新消息:app:prepareComAndroidVolleyVolleyUnspecifiedLibrary 最新消息:app:prepareComFacebookAndroidFacebookAndroidSdk4150Library UP-TO-DATE:app:prepareDebugDependencies:app:compileDebugAidl UP-TO-DATE:app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE:app:mergeDebugShaders UP-TO-DATE:应用程序:compileDebugShaders UP-TO-DATE :app:generateDebugAssets UP-TO-DATE:app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE:app:generateDebugResources UP-TO-DATE:app:mergeDebugResources AAPT:libpng错误:不是PNG文件 :app:mergeDebugResources FAILED错误:任务执行失败 ':应用程序:mergeDebugResources'。
Crunching Cruncher fundo.png失败,请参阅日志
在事件日志中,我得到了:
13:00:18执行任务:[:app:incrementalDebugSupportDex] 13:00:19 Gradle构建在1s 93ms
中完成了1个错误
在Build Gradle控制台:
:app:mergeDebugResources AAPT:libpng错误:不是PNG文件 :app:mergeDebugResources FAILED
失败:构建因异常而失败。
出了什么问题:任务'执行失败':app:mergeDebugResources'。
Crunching Cruncher fundo.png失败,请参阅日志
尝试:使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。
建立失败
总时间:1.006秒
任何人都知道如何解决?
答案 0 :(得分:1)
在build.gradle
android {
....
aaptOptions {
cruncherEnabled = false
}
....
}