About compilation errors for Point 9 in Android Studio

Source: Internet
Author: User

Point 9 in Android must be very familiar with, can specify the background image of the zoom area and text content display area, common such as QQ chat interface background Bubble This text content is not fixed and need to adapt to the application scenario.

Here also to prepare a picture, detailed introduction of "Android design in the. 9.png", you can click to enlarge view:

There were few compile-time problems with the point 9 graph when using Eclipse, but you might encounter it in the process of moving to Android studio. For example, if you convert the Eclipse project into an Android studio project, or introduce a point 9 diagram in your project and clean compile, the following error message appears in the messages console:

Error:Execution failed for task ‘:app:mergeDebugResources‘.> Some file crunching failed, see logs for details
    • 1
    • 2

Crunching failed, according to the error message, can only see some of the file calculation failure, if you do not know the Tao, still really can't find the source of the error. In fact, here is the point 9 figure in the use of Android studio there is a problem.

Android Studio has strict specifications for point 9 graphs, and there is no limit to the number of black lines that control both the zoom area and the content area, and if one is missing, the above error occurs.

Android Studio embedded the SDK in the Draw9patch tool, you can directly open the Point 9 diagram and edit the preview, just the introduction of the point 9 graph four sides of the black line as required to complete, and then clean again, the above error will not appear.

Although the Code Red error is still present in the layout file, it does not affect the normal compilation run. Of course, there is obsessive-compulsive disorder. I am very tangled in this point, if you have any solution must be a message to tell, greatly appreciated.

To add, on the point of the Android studio in the midpoint of the 9 graph of the compiler error problem, the Web also provides another solution, open the Project module directory Build.gradle file, the following two lines of code are added below the Buildtoolsversion statement:

falseaaptOptions.useNewCruncher = false
    • 1
    • 2

But after testing and verification, in addition to the error message to become clearer, and automatically locate and open the wrong picture, or can not bypass the compilation of this, still need to modify the point 9 picture, fill the point 9 of the four-sided black line, I do not know if you have tried it, welcome to exchange discussions.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

About compilation errors for Point 9 in Android Studio

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.