Windows环境下使用svn对AndroidStudio更新代码时,总会在源文件中出现一堆乱码,尤其是xml文件中的乱码,不仅找起来费劲,改起来更费劲。

最近从svn更新代码之后,编译时出现了下面这个提示,而且AS中没有错误提示,这可真是捉急了。

databinding error:Execution failed for task ':app:dataBindingProcessLayoutsDebug'

后来,多亏这篇帖子提示,自己写了段代码来尝试下,http://stackoverflow.com/questions/35097445/android-databinding-errorexecution-failed-for-task-appdatabindingprocesslayo!

果然找到问题了,那么多xml文件,就一个文件头多了一个0xfeff,最终还是找到了那个文件并修改了。下面上一段文件搜索代码,这个解决代码很简单,应该都不是难事吧。

  public static void main(String[] args){
String path="E:\\svn\\ZonetryPlatform\\app\\src\\main\\res\\layout";
File file=new File(path);
String[] list = file.list();
int length = list.length;
System.out.println("file.size="+length);
for (int i = 0; i < length; i++) {
String onePath = list[i];
File oneFile= new File(path, onePath);
FileInputStream fis=null;
FileReader fr=null;
char[] b=new char[1];
try {
// System.out.print("寻找当前文件="+onePath);
fr=new FileReader(oneFile);
fr.read(b, 0, 1);
// System.out.println("the first c of the file = "+b[0]);
if (b[0]==0xfeff){
System.out.println("=========================当前文件出现异常字符, file="+onePath);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}finally {
if (fis!=null){
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
// System.out.println("the first c of the file = "+b[0]);
if (b[0]==0xfeff){ }
}
}

Android中使用databinding编译时出现的error:Execution failed for task ':app:dataBindingProcessLayoutsDebug'的更多相关文章

  1. Android Studio 编译错误 Error:Execution failed for task ':app:buildInfoDebugLoader'.

    今天来到打开昨天的项目运行正常,然后改动了一点代码编译报错: Error:Execution failed for task ':app:buildInfoDebugLoader'. > Exc ...

  2. Android:Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.

    今天开发Android项目时,导入了http有关架包后,程序编译报错如下: Error:Execution failed for task ':app:transformResourcesWithMe ...

  3. 安卓中运行报错Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决

    在androidstuio中运行我的未完项目,报错: Error:Execution failed for task ':app:transformClassesWithDexForDebug'.&g ...

  4. Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException

    异常Log: Error:Execution failed for task ‘:app:dexDebug’. > com.android.ide.common.process.ProcessE ...

  5. 关于android studio 出现Error:Execution failed for task ':app:preDebugAndroidTestBuild'. 的解决办法

    Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency 2018年 ...

  6. Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.Exec

    Error:Execution failed for task ':app:transformClassesWithDexForDebug'.> com.android.build.api.tr ...

  7. Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException总结

    最新项目中遇到了 Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.Proces ...

  8. Android填坑—Error:Execution failed for task ':app:transformClassesWithDexForRelease'

    昨晚正在干着自己的事,另外一个同学说项目打包不了,但是可以debug运行.又急着需要打包apk发给那边人去测试.真的是搞事情,赶紧打开项目试试打包.项目从之前的$Eclipse$中转过来的,清楚的记得 ...

  9. Android Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency

    错误内容: Error:Execution failed for task ':app:preDebugAndroidTestBuild'.> Conflict with dependency ...

随机推荐

  1. spring cloud+.net core搭建微服务架构:Api网关(三)

    前言 国庆假期,一直没有时间更新. 根据群里面的同学的提问,强烈推荐大家先熟悉下spring cloud.文章下面有纯洁大神的spring cloud系列. 上一章最后说了,因为服务是不对外暴露的,所 ...

  2. library Makefiles

    libpng library Makefile LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LS_C=$(subst $(1)/,,$(wild ...

  3. Docker两种方式进入后台运行的容器

    1.在启动容器的时候,有时候我们加了参数-d,这时容器自动进入后台运行.如果我们要进入容器,该怎么办?通常使用docker attach命令和nsenter工具. 2.docker attach是Do ...

  4. 逆向知识之CS辅助/外挂专题.2.实现CS1.6无限夜视仪.无限闪光烟雾高爆弹.

    逆向知识之CS辅助/外挂专题.2.实现CS1.6无限夜视仪.无限闪光烟雾高爆弹. 关于人物子弹无限可以观看上一篇博客. 一丶无限夜视仪. 无限夜视仪找法. 1.CE附加游戏. 2.搜索0或者1. 3. ...

  5. mysql查看表注释和字段注释的方法

    1.取字段注释 Select COLUMN_NAME 列名, DATA_TYPE 字段类型, COLUMN_COMMENT 字段注释from INFORMATION_SCHEMA.COLUMNSWhe ...

  6. 用pip安装python库下载timeout的解决办法

    我们直接用命令:pip install 库名,因网络太慢,导致下载超时~~~ 针对在安装Python库出现的超时问题---总结了如下两种解决方案: 其一:pip --default-timeout=1 ...

  7. .NET源码中的链表

    .NET中自带的链表是LinkedList类,并且已经直接实现成了双向循环链表. 其节点类LinkedListNode的数据结构如下,数据项包括指示到某个链表的引用,以及左,右节点和值. public ...

  8. VB.NET 窗體操作

    Private Sub A1() '加载窗体 frm1.Show() End Sub Private Sub A2() '離開 Process.GetCurrentProcess().Kill() E ...

  9. 23种设计模式+J2EE设计模式学习笔记-初识设计模式

    设计模式简介: 设计模式是一套被反复使用的.多数人知晓的.经过分类编目的.代码设计经验的总结.(个人理解:设计模式是不关乎业务,逻辑实现,针对普遍问题的一种解决方案). 设计模式的类型: 传统23种设 ...

  10. inheritCombination.js

    // 组合继承 // 其基本思路是使用原型链实现对原型属性和方法的继承,而通过借用构造函数来实现对实例属性的继承 function Person(name){ this.name = name; th ...