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