Build time error: content is not allowed in prolog

Cassius :

I am not able to build. I know the error is in jdkAnnotations.jar. I reinstalled android studio, but the problem persists. It also says no IDEA annotations attached in jdk 1.8. Should i reinstall jdk 1.8 also? i am clicking on the button that says attach annotations but nothing is happening. Please help. And why is this problem happening? is there something wrong in any xml resource file or what?

C:/Program Files/Android/Android Studio/lib/jdkAnnotations.jar!/java/awt/event/annotations.xml: Content is not allowed in prolog.
    org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
AndroidDev :

I got the same error today. Just reinstalling Android Studio did not help. The following steps worked for me:

  1. Close Android Studio
  2. Go to C:\Users\Username
  3. Delete the whole folders: ".AndroidStudioX.X" and ".gradle"
  4. Start Android Studio

Now all the Settings will be reinstalled and you can work on with your project

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=86136&siteId=1