Android Studio中关于9-patch格式图片的编译错误
生活随笔
收集整理的這篇文章主要介紹了
Android Studio中关于9-patch格式图片的编译错误
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
最近在編譯Android?Studio開(kāi)發(fā)的項(xiàng)目中在使用了9宮圖后出現(xiàn)了編譯錯(cuò)誤,嘗試了多種方法未能解決,最后仔細(xì)查看出錯(cuò)的日志發(fā)現(xiàn),居然是圖片的原因,圖片中包含有alpah通道所以在執(zhí)行app:mergeDebugResources時(shí)出現(xiàn)了錯(cuò)誤 ,解決方法就是讓美工重新?lián)Q一張沒(méi)有alpha通道的9宮圖就好了,或者可以自行修改,在sdk\tools下自帶的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:mergeDebugResourcesAAPT err(Facade for 1317812410): ERROR: 9-patch image \\?\D:\MyProject\Android\Timer\app\src\main\res\drawable-hdpi\bg_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:\MyProject\Android\Timer\app\src\main\res\drawable-hdpi\bg_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:\MyProject\Android\Timer\app\src\main\res\drawable-hdpi\bg_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
來(lái)自為知筆記(Wiz)
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:mergeDebugResourcesAAPT err(Facade for 1317812410): ERROR: 9-patch image \\?\D:\MyProject\Android\Timer\app\src\main\res\drawable-hdpi\bg_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:\MyProject\Android\Timer\app\src\main\res\drawable-hdpi\bg_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:\MyProject\Android\Timer\app\src\main\res\drawable-hdpi\bg_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
來(lái)自為知筆記(Wiz)
轉(zhuǎn)載于:https://www.cnblogs.com/jeffen/p/6813520.html
總結(jié)
以上是生活随笔為你收集整理的Android Studio中关于9-patch格式图片的编译错误的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: java中的jdk切换(无需卸载原有jd
- 下一篇: Android动画原理