我在构建/执行 Android Studio 项目时遇到错误。
错误:
:app:mergeDebugResources FAILED Error:Execution failed for task ':app:mergeDebugResources'.
Some file crunching failed, see logs for details
我已经阅读了关于 SO 的帖子并做了以下事情来修复它,但我仍然无法摆脱错误。
清理项目。
使 Android Studio 失效并重启。
我已经将 Gradle 版本从 1.3.0 升级到 1.5.0。
我还升级了 buildToolsVersion '23.0.1'。
还有一些 Gradle traces 供引用:
Information:Gradle tasks [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugAndroidTestSources] :app:clean :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72300Library :app:prepareComAndroidSupportDesign2300Library :app:prepareComAndroidSupportSupportV42300Library :app:prepareComCrashlyticsSdkAndroidAnswers131Library :app:prepareComCrashlyticsSdkAndroidBeta113Library :app:prepareComCrashlyticsSdkAndroidCrashlytics251Library :app:prepareComCrashlyticsSdkAndroidCrashlyticsCore234Library :app:prepareComGithubClansFab155Library :app:prepareComGithubPaolorotoloAppintro320Library :app:prepareComGoogleAndroidGmsPlayServicesBase780Library :app:prepareComGoogleAndroidGmsPlayServicesGcm780Library :app:prepareIoFabricSdkAndroidFabric135Library :app:prepareJpWasabeefBlurry101Library :app:prepareDebugDependencies :app:compileDebugAidl :app:compileDebugRenderscript :app:generateDebugBuildConfig :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets :app:generateDebugResValues UP-TO-DATE :app:processDebugGoogleServices :app:generateDebugResources :app:mergeDebugResources
AAPT: ERROR: 9-patch image /Users/v/app/src/main/res/drawable-xxxhdpi/btn_small_white_normal.9.png malformed. AAPT: Found at pixel #21 along top edge. AAPT: /Users/v/Documents/app/src/main/res/drawable-mdpi/ic_send_black_disabled_24dp.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited :app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:mergeDebugResources'.
Some file crunching failed, see logs for details
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。
构建失败
最佳答案
我找到了这个问题的解决方案,它可能是一个临时解决方案,但目前有效。 此问题是由于 9 补丁图像的问题而产生的。
看看痕迹中的这一行,它是抛出错误。
AAPT: ERROR: 9-patch image /Users/v/app/src/main/res/drawable-xxxhdpi/btn_small_white_normal.9.png malformed. AAPT: Found at pixel #21 along top edge.
我已通过重命名 Assets 并从文件名中删除 .9 来修复错误。 9 补丁文件是一个格式错误的 Assets ,Android Studio 在修复之前不会构建。
你可以让你的设计师帮你修好。
关于android - 应用程序 :mergeDebugResources error in Android Studio after upgrade,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33824237/