Error:execution failed for task ': App:databindingprocesslayoutsdebug ' when compiling with databinding in Android

Source: Internet
Author: User

When using SVN to update the code in the Windows environment, there will always be a heap of garbled characters in the source file, especially the garbled characters in the XML file, which is not only hard to find, but also more laborious to Androidstudio.

After the recent update of the code from SVN, the following prompt appears at compile time, and there is no error in the AS, which is a real catch.

DataBinding error:execution failed for task ': App:databindingprocesslayoutsdebug '

Later, thanks to this post hint, I wrote a piece of code to try, http://stackoverflow.com/questions/35097445/ Android-databinding-errorexecution-failed-for-task-appdatabindingprocesslayo!

Sure enough to find the problem, so many XML files, a file header more than a 0xFEFF, eventually found the file and modified. The next section of the file search code, this solution code is very simple, it should not be difficult.

1   Public Static voidMain (string[] args) {2String path= "E:\\svn\\zonetryplatform\\app\\src\\main\\res\\layout";3File file=NewFile (path);4string[] List =file.list ();5         intLength =list.length;6System.out.println ("file.size=" +length);7          for(inti = 0; i < length; i++) {8String OnePath =List[i];9File onefile=NewFile (path, onepath);TenFileInputStream fis=NULL; OneFileReader fr=NULL; A             Char[] b=New Char[1]; -             Try { - //System.out.print ("Looking for current file =" +onepath); theFr=NewFileReader (onefile); -Fr.read (b, 0, 1); - //System.out.println ("The first c of the file =" +b[0]); -                 if(B[0]==0xfeff){ +System.out.println ("========================= current file has an exception character, file=" +OnePath); -                 } +}Catch(FileNotFoundException e) { A e.printstacktrace (); at}Catch(IOException e) { - e.printstacktrace (); -}finally { -                 if(fis!=NULL){ -                     Try { - fis.close (); in}Catch(IOException e) { - e.printstacktrace (); to                     } +                 } -             } the //System.out.println ("The first c of the file =" +b[0]); *             if(B[0]==0xfeff){ $ Panax Notoginseng             } -         } the}

Error:execution failed for task ': App:databindingprocesslayoutsdebug ' when compiling with databinding in Android

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.