The opinion of the court was delivered by
Johnston, C. J.:This action was brought by the Baker-Ossmann Hardware Company, to obtain a subcontractor’s material lien upon a lot owned by Wylie R. Griffin. Other parties who claimed liens on the party, including the Concordia Lumber Company, were made deféndants. The other defendants, except Griffin, set up their claims for liens. Griffin did not appear or answer. In the answer and cross petition filed by the Concordia Lumber Company there *449was set forth the filing of their statement for a subcontractor’s lien, which contained an itemized statement of the materials furnished, and was duly signed and verified by the agent and manager of the company. The statement was made a part of the petition, but there was no averment in the petition that notice of the lien had been served upon the owner. There was a copy of an affidavit made by an attorney of the company in which it was recited that Griffinthe owner was absent from the county, that service of the notice could not be made upon him, that his wife and family were also absent from the county, and the premises unoccupied, and further that the affiant had posted in. a conspicuous place on the residence a copy of the statement. This affidavit was attached as an exhibit. The court sustained a demurrer to the cross petition. The defect in the petition pointed out by the demurrer was that it contained no averment of the service of notice and none was contained in it unless it can be said to have been supplied by the affidavit attached as an exhibit. Notice of the lien is essential to its existence. The lien being statutory, a compliance with the statutory requirements must be observed. In Powers v. Lumber Co., 75 Kan. 687, 90 Pac. 254, it was said:
“There is no privity of contract between the subcontractor and the owner, and the former can only obtain a lien by compliance with the statutory provisions. It is not enough that he has furnished the material and filed his lien. The service of notice upon the owner is one of the necessary steps. Without such notice he obtains nothing. The right to claim and enforce his lien being statutory, the action can only be maintained upon a petition alleging a compliance with the statute.”
The foundation of the action of the company was the statement for a lien, and while the affidavit attached as an exhibit might have been used as evidence it cannot be regarded as a part of the statement or a substitute for an essential averment of the petition. The trial court ruled that it devolved on the party claiming the lien to definitely allege that notice to the owner had been given, and therefore sustained the demurrer to the cross petition. In view of the nature of the action, and that such liens can only be acquired and enforced upon the conditions prescribed by statute, we conclude that the petition was defective as against a demurrer.
The judgment is therefore affirmed.