zoukankan      html  css  js  c++  java
  • Android Studio中关于9-patch格式图片的编译错误

    最近在编译Android Studio开发的项目中在使用了9宫图后出现了编译错误,尝试了多种方法未能解决,最后仔细查看出错的日志发现,居然是图片的原因,图片中包含有alpah通道所以在执行app:mergeDebugResources时出现了错误 ,解决方法就是让美工重新换一张没有alpha通道的9宫图就好了,或者可以自行修改,在sdk ools下自带的draw9patch工具。

    Executing tasks: [assembleDebug]

    Parallel execution with configuration on demand is an incubating feature.
    Incremental java compilation is an incubating feature.
    :app:preBuild UP-TO-DATE
    :app:preDebugBuild UP-TO-DATE
    :app:checkDebugManifest
    :app:prepareDebugDependencies
    :app:compileDebugAidl UP-TO-DATE
    :app:compileDebugRenderscript UP-TO-DATE
    :app:generateDebugBuildConfig UP-TO-DATE
    :app:generateDebugResValues UP-TO-DATE
    :app:generateDebugResources UP-TO-DATE
    :app:mergeDebugResources
    AAPT err(Facade for 1317812410): ERROR: 9-patch image \?D:MyProjectAndroidTimerappsrcmain esdrawable-hdpig_bottom_right_pressed.9.png malformed.
    AAPT err(Facade for 1317812410):        Must have one-pixel frame that is either transparent or white.
    AAPT err(Facade for 1317812410): ERROR: 9-patch image \?D:MyProjectAndroidTimerappsrcmain esdrawable-hdpig_bottom.9.png malformed.
    AAPT err(Facade for 1317812410):        No marked region found along edge.
    AAPT err(Facade for 1317812410):        Found along top edge.
    AAPT err(Facade for 1411147031): ERROR: 9-patch image \?D:MyProjectAndroidTimerappsrcmain esdrawable-hdpig_bottom_left_pressed.9.png malformed.
    AAPT err(Facade for 1411147031):        Must have one-pixel frame that is either transparent or white.

    Error: Some file crunching failed, see logs for details
    :app:mergeDebugResources FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':app:mergeDebugResources'.
    > Error: Some file crunching failed, see logs for details

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    BUILD FAILED

    Total time: 1.503 secs





  • 相关阅读:
    OpenSLAM
    CAD&CG GDC 2018大会论文录用名单
    hdu4328(经典dp用悬线法求最大子矩形)
    hdu3729(二分图)
    hdu 4055(经典问题)
    Codeforces Round #207 (Div. 1) B (gcd的巧妙运用)
    hdu1066(经典题)
    zoj3662(dp)
    zoj3659(经典并查集)
    hdu4565(矩阵快速幂+经典的数学处理)
  • 原文地址:https://www.cnblogs.com/jeffen/p/6813520.html
Copyright © 2011-2022 走看看