
36 Cal.Rptr.3d 532 (2005)
134 Cal.App.4th 1035
BANIS RESTAURANT DESIGN, INC., Plaintiff and Appellant,
v.
Borgata SERRANO et al., Defendants and Respondents.
No. C048900.
Court of Appeal, Third District.
November 18, 2005.
*534 Craig N. Beardsley, Jones & Beardsley, Bakersfield, CA, for Plaintiff and Appellant.
Kenneth M. Hardgrove, Sherwood and Hardgrove, Los Angeles, CA, for Defendants and Respondents.
*533 HULL, J.
Business and Professions Code section 7031, subdivision (a) precludes an unlicensed contractor from filing suit "for the collection of compensation for the performance of any act or contract where a license is required[.]" (Unspecified statutory references that follow are to the Business and Professions Code.)
When plaintiff Banis Restaurant Design, Inc., filed suit against defendants Borgata Serrano (Serrano) and Bank of America to recover the unpaid balance on a contract, defendants responded by filing a demurrer, asserting in part that plaintiff was not a licensed contractor and therefore was barred from seeking relief. The trial court agreed and sustained the demurrer without leave to amend.
On appeal from the ensuing judgment of dismissal, plaintiff contends that the court should have permitted amendment of its complaint to allege facts demonstrating that the absolute bar of section 7031 did not apply. We conclude any such allegations would have contradicted plaintiff's original pleadings, and therefore affirm the judgment.

STANDARD OF REVIEW
"A demurrer tests the sufficiency of a complaint and admits all facts properly pleaded." (Setliff v. E.I. Du Pont de Nemours & Co. (1995) 32 Cal.App.4th 1525, 1533, 38 Cal.Rptr.2d 763.) "When reviewing a judgment dismissing a complaint after the granting of a demurrer without leave to amend, courts must assume the truth of the complaint's properly pleaded or implied factual allegations. [Citation.] Courts must also consider judicially noticed matters. [Citation.] In addition, we give the complaint a reasonable interpretation, and read it in context. [Citation.] If the trial court has sustained the demurrer, we determine whether the complaint states facts sufficient to state a cause of action." (Schifando v. City of Los Angeles (2003) 31 Cal.4th 1074, 1081, 6 Cal.Rptr.3d 457, 79 P.3d 569.) In making this determination, we are not bound by the trial court's construction but instead make our own independent judgment as to the sufficiency of the complaint. (Marina Tenants Assn. v. Deauville Marina Development Co. (1986) 181 Cal.App.3d 122, 127, 226 Cal.Rptr. 321; see also Vallejo Development Co. v. Beck Development Co. (1994) 24 Cal.App.4th 929, 937, 29 Cal.Rptr.2d 669 [applicability of section 7031 presents question of law requiring de novo review].)
If a court sustains a demurrer without leave to amend, "we must decide whether there is a reasonable possibility the plaintiff could cure the defect with an amendment. [Citation.] If we find that an amendment could cure the defect, we conclude that the trial court abused its discretion and we reverse; if not, no abuse of *535 discretion has occurred. [Citation.] The plaintiff has the burden of proving that an amendment would cure the defect." (Schifando v. City of Los Angeles, supra, 31 Cal.4th at p. 1081, 6 Cal.Rptr.3d 457, 79 P.3d 569.) This showing may be made for the first time in the appellate court, but it must be made. (Smith v. State Farm Mutual Automobile Ins. Co. (2001) 93 Cal.App.4th 700, 711, 113 Cal.Rptr.2d 399; Code Civ. Proc., § 472c.)

FACTS AND PROCEEDINGS
In July 2004, plaintiff filed a complaint alleging seven causes of action relating to an unpaid balance on a contract.
The first cause of action, for breach of contract, asserted that plaintiff "was in good faith and substantial compliance with all applicable licensing statutes." Plaintiff asserted that in December 2001, it entered into a contract with defendant Serrano "to provide design labor, materials, equipment and services to be used and incorporated into the work of improvement referenced herein as the PROJECT." Between January 2002 and May 2004, plaintiff and defendant Serrano "entered into a series of additional agreements, some written and others verbal, all confirmed by written invoices for the provision by plaintiff to defendants of additional labor, materials, equipment and services to the Project. Plaintiff furnished all labor services, equipment and materials for use by defendant[] in the PROJECT. All of said labor, services, equipment and materials were to be used or consumed in, and were actually used or consumed in said PROJECT. The agreed sum to be paid to plaintiff for labor, materials, equipment and services provided by plaintiff was and is the principal amount of $1,773,943.33. Defendants have paid to plaintiff the amount of $1,554,095.21. The balance of $219,848.12 remains unpaid, due and owing to Plaintiff."
A second cause of action sought to foreclose on a mechanic's lien. Plaintiff incorporated its previous allegations and asserted that in May 2004, after it had "ceased performance and the furnishing of labor, equipment, materials and services to the work of improvement," it filed and recorded a mechanic's lien for $216,821.80, "which price is the reasonable value of all labor, materials and services plaintiff has furnished, after deducting all just credits." Plaintiff also alleged that any interest of defendant Serrano or defendant Bank of America in this property was subordinate to plaintiff's lien.
The third through sixth causes of actions alleged alternative theories for recovery of the unpaid balance by incorporating the allegations from the breach of contract cause of action and asserting claims entitled "Common Count  Agreed Amount," "Common Count  Reasonable Value," "Common Count  Account Stated," and "Open Book Account."
The seventh cause of action, entitled "Stop Notice," asserted that plaintiff had served a verified stop notice on defendants Serrano and Bank of America, that there had been sufficient funds to pay plaintiff's claims, but that defendants had not paid the amount due.
Plaintiff sought general damages in the amount of $219,848.12. It also asked the court to foreclose on the mechanic's lien, declare that lien superior to any interests of defendant, and order the real and personal property be sold, with proceeds applied to plaintiff's claim. Plaintiff also sought an order "directing payment to plaintiff from the funds withheld, or which should have been withheld" by defendant Bank of America.
*536 Plaintiff incorporated several exhibits into its complaint, including the design/furnish contract it had entered into with defendant Serrano (exh. A) and the mechanic's lien it had recorded (exh. B).
Exhibit A, the contract between plaintiff and defendant Serrano, described the job as a "Restaurant and Market Project" and provided that plaintiff "shall prepare the drawings and specifications for the interior of the Project, and shall also procure the equipment, furnishings, material for the Project." Section IV of the agreement provided that "[c]ompensation for design services shall be $16,000." Section VII listed the design services to be provided as:
"1. Floor plan
"2. Equipment & Fixture List
"3. Electrical Plan Drawings
"4. Plumbing Plan Drawings
"5. Reflected Ceiling Plan Drawings
"6. Color selections
"7. Coordination of Architect, Electrical, Mechanical and Structural Engineers
"8. Business Plan
"9. Interior elevations of all eating areas."
Section V of the agreement was entitled "Compensation for Procurement of Equipment, Furnishings, Materials and Labor." It provided in relevant part:
"For Professional Services for the procurement of Project equipment, furnishings, material, and related labor, [plaintiff's] Compensation is to be incorporated in a Presented price in the form of a Proposal to the client of all equipment, furnishings, materials, and labor required to complete the Project. It is agreed that all equipment, furnishings, materials, and labor shall be purchased exclusively through [plaintiff], which [sic] the exception of furniture purchase in Italy by the client."
Exhibit B, the mechanic's lien, stated that plaintiff claimed a mechanic's lien for the labor, services of the labor, services, equipment and or materials furnished for a work of improvement on defendant Serrano's property. Plaintiff described this work as "FURNISHED RESTAURANT EQUIPMENT AND FURNISHINGS," and signed a verification under penalty of perjury.
Defendants demurred to plaintiff's complaint, asserting in part that plaintiff was not a licensed contractor and therefore was barred from seeking recovery for any amounts owed under the contract.
Plaintiff responded that because its agreement was limited to providing design work for defendant Serrano, no contractor's license was required. It also argued that it was exempt from licensing provisions under sections 7045 and 7052. Section 7045 provides that the licensing provisions do not apply "to the sale or installation of any finished products, materials, or articles of merchandise that do not become a fixed part of the structure, nor shall it apply to a material supplier or manufacturer furnishing finished products, materials, or articles of merchandise who does not install or contract for the installation of those items." Section 7052 exempts from licensing requirements "any person who only furnishes materials or supplies without fabricating them into, or consuming them in the performance of, the work of the contractor."
In reply, defendants asserted that plaintiff's own description of the work to be performed for defendant Serrano encompassed far more than design services, and required a contractor's license. They also argued that the claimed statutory exemptions did not apply.
*537 The trial court agreed with defendants and sustained the demurrer without leave to amend. Plaintiff appeals from the ensuing judgment of dismissal.

DISCUSSION
On appeal, plaintiff's sole claim is that the trial court abused its discretion in denying it an opportunity to amend its complaint. Plaintiff contends that it could allege facts demonstrating that, under the terms of sections 7045 and 7052, the work it provided to defendant Serrano did not require a contractor's license. We do not agree.
The Contractors' State License Law (§ 7000 et seq.) is intended to "protect the public from incompetence and dishonesty in those who provide building and construction services. [Citation.] The licensing requirements provide minimal assurance that all persons offering such services in California have the requisite skill and character, understand applicable local laws and codes, and know the rudiments of administering a contracting business." (Hydrotech Systems, Ltd. v. Oasis Waterpark (1991) 52 Cal.3d 988, 995, 277 Cal.Rptr. 517, 803 P.2d 370 (Hydrotech); see also Hunt Building Corp. v. Bernick (2000) 79 Cal.App.4th 213, 217-218, 93 Cal.Rptr.2d 883.)
Section 7031, subdivision (a) provides in relevant part that "no person engaged in the business or acting in the capacity of a contractor, may bring or maintain any action, or recover in law or equity in any action, in any court of this state for the collection of compensation for the performance of any act or contract where a license is required by this chapter without alleging that he or she was a duly licensed contractor at all times during the performance of that act or contract, regardless of the merits of the cause of action brought by the person...."
Section 7031 advances the policies behind the Contractors' State License Law "by withholding judicial aid from those who seek compensation for unlicensed contract work. The obvious statutory intent is to discourage persons who have failed to comply with the licensing law form offering or providing their unlicensed services for pay. [¶] Because of the strength and clarity of this policy, it is well settled that section 7031 applies despite injustice to the unlicensed contractor. `Section 7031 represents a legislative determination that the importance of deterring unlicensed persons from engaging in the contracting business outweighs any harshness between the parties, and that such deterrence can best be realized by denying violators the right to maintain any such action for compensation the courts of this state. [Citation.]'" (Hydrotech, supra, 52 Cal.3d at p. 995, 277 Cal.Rptr. 517, 803 P.2d 370.)
"Regardless of the equities, section 7031 bars all actions, however they are characterized, which effectively seek `compensation' for illegal unlicensed contract work. [Citation.] Thus, an unlicensed contractor cannot recover either for the agreed contract price or for the reasonable value of labor and materials." (Hydrotech, supra, 52 Cal.3d at p. 997, 277 Cal.Rptr. 517, 803 P.2d 370.) Similarly, section 7031 precludes the enforcement of a mechanic's lien. (Vallejo Development Co. v. Beck Development Co., supra, 24 Cal.App.4th at p. 939, 29 Cal.Rptr.2d 669.)
Public policy concerns are so strong that section 7031 applies "even where the person for whom the work was performed knew the contractor was unlicensed." (Hydrotech, supra, 52 Cal.3d at p. 997, 277 Cal.Rptr. 517, 803 P.2d 370.) And section 7031, subdivision (e) provides in relevant part that "[t]he judicial doctrine of substantial compliance shall not apply under *538 this section where the person who engaged in the business or acted in the capacity of a contractor has never been a duly licensed contractor in this state." (See generally Pacific Custom Pools, Inc. v. Turner Construction Co. (2000) 79 Cal.App.4th 1254, 1261-1262, 94 Cal.Rptr.2d 756.)
The initial question before us is whether plaintiff was "engaged in the business or acted in the capacity of a contractor," thereby bringing section 7031 into play. Rather than arguing this question at any length, plaintiff instead focuses its briefing on statutes exempting certain specific conduct from the Contractors' State License Law. To the extent that plaintiff suggests that it was not a contractor, we disagree.
Section 7026 provides in relevant part that, for purposes of the Contractors' State License Law, "contractor" is synonymous with "builder" and means "any person who undertakes to ... or does himself or herself or by or through others, construct, alter, repair, add to, subtract from, improve ... or demolish any building, or other structure, project, development or improvement, or to do any part thereof, including the erection of scaffolding or other structures or works in connection therewith ... and whether or not the performance of work herein described involves the addition to, or fabrication into, any structure, project, development or improvement herein described of any material or article of merchandise. `Contractor' includes subcontractor and specialty contractor...."
Section 7026.1, subdivision (b) also includes within the definition of "contractor" any business "which undertakes ... to construct any building ... or part thereof."
Plaintiff's complaint and contract describe work that comes within the statutory definition of a contractor. According to plaintiff's complaint, it provided more than $1.7 million of labor, materials, equipment, and services to defendant Serrano for its restaurant project. The contract specified this work as including drawings for electrical and plumbing plans, drawing plans for a reflected ceiling, and coordination of the architect, electrical engineers, mechanical engineers and structural engineers. Through its own efforts and those of others, plaintiff thereby undertook to "construct," "alter," "add to," "subtract from" and/or "improve" defendant's project. (See § 7026.) In short, plaintiff was a contractor, and section 7031 bars plaintiff's suit for compensation.
Plaintiff asserts it should have been permitted to amend its complaint to allege facts giving rise to certain exceptions to the contractors' licensing statutes. We address each claimed exception in turn. First, however, we reiterate principles governing the amendment of complaints.
As we have already noted, it is an abuse of discretion to sustain a demurrer without leave to amend if the plaintiff meets its burden of demonstrating a reasonable possibility that the defect can be cured by amendment. (Schifando v. City of Los Angeles, supra, 31 Cal.4th at p. 1081, 6 Cal.Rptr.3d 457, 79 P.3d 569.) However, when a complaint contains allegations that are fatal to a cause of action, a plaintiff cannot avoid those defects simply by filing an amended complaint that omits the problematic facts or pleads facts inconsistent with those alleged earlier. (Hendy v. Losse (1991) 54 Cal.3d 723, 742-743, 1 Cal.Rptr.2d 543, 819 P.2d 1; Pierce v. Lyman (1991) 1 Cal.App.4th 1093, 1109, 3 Cal.Rptr.2d 236.) Absent an explanation for the inconsistency, a court will read the original defect into the amended complaint, rendering it vulnerable to demurrer again. (Hendy v. Losse, supra, at p. 743, 1 Cal.Rptr.2d 543, 819 P.2d 1; Owens v. Kings Supermarket (1988) 198 Cal.App.3d *539 379, 384, 243 Cal.Rptr. 627.) Facts appearing in exhibits attached to a complaint will also be accepted as true and will be given precedence over any contrary allegations in the pleadings. (Holland v. Morse Diesel Internat., Inc. (2001) 86 Cal.App.4th 1443, 1447, 104 Cal.Rptr.2d 239; Dodd v. Citizens Bank of Costa Mesa (1990) 222 Cal.App.3d 1624, 1627, 272 Cal.Rptr. 623.)
With these principles in mind, we address plaintiff's specific claims.
Plaintiff contends that it could have amended its complaint to demonstrate the applicability of section 7045, which provides that the Contractors' State License Law does not apply "to the sale or installation of any finished products, materials or articles of merchandise that do not become a fixed part of the structure, nor shall it apply to a material supplier or manufacturer furnishing finished products, materials, or articles of merchandise who does not install or contract for the installation of those items."
Plaintiff asserts that at least a portion of the products and services it provided did not involve fixtures, and it should therefore be permitted to amend its complaint to seek recovery for those items under section 7045.
Such an amendment would directly contradict plaintiff's earlier pleadings. Plaintiff's initial complaint included a cause of action to foreclose on a mechanic's lien for $216,821.80 that it had previously recorded, and it attached a copy of that lien as exhibit B to its complaint.
"The mechanic's lien attaches when the mechanic's materials are physically incorporated into the structure. In effect, the material supplied must be attached to and incorporated into the project so that it becomes a fixture, and the supplier cannot have a lien if it remains personal property." (10 Miller & Starr, California Real Estate (3d ed. 2001) § 28.10, pp. 39-40, fn. omitted.)
By definition, a mechanic's lien involves fixtures. In filing its lien, under penalty of perjury, plaintiff in essence asserted that the materials it provided were fixtures on the property. Plaintiff argues that this characterization is unfair because it described the labor, services, equipment, and materials it furnished as "RESTAURANT EQUIPMENT AND FURNISHINGS." But plaintiff's description is not determinative. A mechanic's lien is appropriate only if the supplied materials are fixtures. Plaintiff's attempt to redefine this remedy is unavailing.
Plaintiff's reliance on cases such as Walker v. Thornsberry (1979) 97 Cal.App.3d 842, 158 Cal.Rptr. 862 (Walker) is misplaced. In Walker, the trial court concluded that a manufacturer of a prefabricated restroom was not required to have a contractor's license to place the prefabricated unit on a site prepared by the defendant, and it therefore found that section 7031 did not preclude the manufacturer from seeking recovery on the unpaid balance. (Id. at pp. 843-844, 158 Cal.Rptr. 862.) This court affirmed, concluding that section 7045 permitted recovery. (Id. at pp. 846-848, 158 Cal.Rptr. 862.) The contract between the parties did not require "the installation of concrete foundation, rough plumbing, or installation of plumbing fixtures, stalls, wood roofing, and painting upon which to place the prefabricated restroom. [The manufacturer's] employees merely assembled the pieces and bolted the structure to the foundation." (Id. at p. 848, 158 Cal.Rptr. 862.)
Here, in contrast, plaintiff's services involved more than incidental labor. The contract called for plaintiff to provide drawings for electrical, plumbing, and ceiling plans. Plaintiff was also to coordinate work with architects as well as structural, *540 mechanical, and electrical engineers. The work plaintiff was hired to do cannot be compared with that in Walker.
The case before us differs from Walker in another significant respect. Walker did not involve a mechanic's lien, leaving open the question of whether the contract involved personal property or fixtures. No such question remained to be answered here. By filing a mechanic's lien, plaintiff characterized the work it had done as fixtures, making section 7045 inapplicable. Plaintiff cannot avoid this problem by filing an amended complaint that ignores or contradicts its earlier pleadings. (Hendy v. Losse, supra, 54 Cal.3d at pp. 742-743, 1 Cal.Rptr.2d 543, 819 P.2d 1.)
Plaintiff meets with no more success under the second exemption it claims. Section 7052 provides that the Contractors' State License Law "does not apply to any person who only furnishes materials or supplies without fabricating them into, or consuming them in the performance of, the work of the contractor." Plaintiff's earlier pleadings establish that this exemption is inapplicable. Plaintiff's complaint specifically stated that all labor, services, equipment and materials it provided "were to be used or consumed in, and were actually used or consumed in" the project. Plaintiff cannot avoid a demurrer by filing an amended complaint that contradicts its earlier complaint. (Hendy v. Losse, supra, 54 Cal.3d at pp. 742-743, 1 Cal.Rptr.2d 543, 819 P.2d 1.)
Citing cases such as Johnson v. Mattox (1968) 257 Cal.App.2d 714, 65 Cal.Rptr. 185, plaintiff also suggests that it should be permitted to amend its complaint to seek recovery for any portion of its work that did not require a contractor's license. Plaintiff's contract is not severable in the manner suggested.
Initially, we note that a contract made by an unlicensed person in violation of the licensing laws is void. (Wilson v. Steele (1989) 211 Cal.App.3d 1053, 1059-1060, 259 Cal.Rptr. 851.) Plaintiff does not explain how a void contract can be enforced. But even if we were to take a less stringent approach and conclude that an otherwise valid portion of a void contract might be severed and maintain its viability, this is not such a case. We explain.
In Johnson, an unlicensed contractor was precluded from recovering nearly $8,000 for work it had done to build a baseball school. (Johnson v. Mattox, supra, 257 Cal.App.2d at pp. 716-719, 65 Cal.Rptr. 185.) Its contract included a $650 charge for the sale of goods, namely, a tractor and mowers. (Id. at p. 716, 65 Cal.Rptr. 185.) The appellate court agreed that the contractor's lack of license barred recovery for its construction work. However, the court also found that no license was required to sell the tractor and mowers. (Id. at p. 719, 65 Cal.Rptr. 185.) Because this sale was unrelated to the building and construction activities and because the mowers and tractor were not fixtures, the court severed the sale from the rest of the contract and awarded compensation for these items. (Ibid.)
Here, however, the work plaintiff provided was part of an integrated whole. Plaintiff has offered no specifics to explain how any portion of the contract is incidental to any other, or why any portion should be severed from any other portion. (See Vallejo Development Co. v. Beck Development Co., supra, 24 Cal.App.4th at p. 944, 29 Cal.Rptr.2d 669.) The parties' contract demonstrates that each aspect of plaintiff's work was integral to the restaurant project, and was not minor or incidental. (Cf. Walker, supra, 97 Cal.App.3d at p. 848, 158 Cal.Rptr. 862.) And again we note that plaintiff filed a mechanic's lien for the unpaid balance, an act that by definition recognizes that its work involved fixtures, *541 thus further distinguishing this case from Johnson.
In sum, plaintiff has not met its burden of proof to demonstrate how its complaint might be amended. (See Schifando v. City of Los Angeles, supra, 31 Cal.4th at p. 1081, 6 Cal.Rptr.3d 457, 79 P.3d 569.) The trial court properly sustained defendant's demurrer without leave to amend. There was no error.

DISPOSITION
The judgment is affirmed. Defendants are awarded their costs on appeal.
SIMS, Acting P.J., and MORRISON, J., concur.
