midhunhk
midhunhk

Reputation: 5554

Gradle Cannot Resolve symbol XmlParser()

I have the an implementation in one of my build.gradle files of an Android app that I was using to check some data in the resource file.

new XmlParser().parse(stringsFile).string.find { [email protected] keyName }.text()

This seemed to have been working fine until I decided to upgrade the following

Now I am getting the error 'Cannot find Symbol XmlParser'.

There is no indication of this class being deprecated and I can find it in Groovy documentation. Basically I am trying to read a value from one of the resource xml files in one of the build steps.

Upvotes: 2

Views: 2755

Answers (1)

daggett
daggett

Reputation: 28624

Since groovy 4 the package for xml classes has been changed from groovy.util to groovy.xml.

So, now you have to import it differently

import groovy.xml.XmlParser

Upvotes: 5

Related Questions