Android中使用databinding编译时出现的error:Execution failed for task ':app:dataBindingProcessLayoutsDebug'
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'的更多相关文章
- Android Studio 编译错误 Error:Execution failed for task ':app:buildInfoDebugLoader'.
今天来到打开昨天的项目运行正常,然后改动了一点代码编译报错: Error:Execution failed for task ':app:buildInfoDebugLoader'. > Exc ...
- Android:Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
今天开发Android项目时,导入了http有关架包后,程序编译报错如下: Error:Execution failed for task ':app:transformResourcesWithMe ...
- 安卓中运行报错Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决
在androidstuio中运行我的未完项目,报错: Error:Execution failed for task ':app:transformClassesWithDexForDebug'.&g ...
- 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 ...
- 关于android studio 出现Error:Execution failed for task ':app:preDebugAndroidTestBuild'. 的解决办法
Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency 2018年 ...
- 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 ...
- 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 ...
- Android填坑—Error:Execution failed for task ':app:transformClassesWithDexForRelease'
昨晚正在干着自己的事,另外一个同学说项目打包不了,但是可以debug运行.又急着需要打包apk发给那边人去测试.真的是搞事情,赶紧打开项目试试打包.项目从之前的$Eclipse$中转过来的,清楚的记得 ...
- Android Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency
错误内容: Error:Execution failed for task ':app:preDebugAndroidTestBuild'.> Conflict with dependency ...
随机推荐
- DPI 计算及速查表
[来源]ExMobi 二次开发手册 手机屏幕根据密度范围分为五种:低.中.高.超高.超超高,为了确保界面元素在不同的屏幕都能合适的展示,在设计界面元素的 UI 时,UI 工程师建议统一采用 dpi ( ...
- textarea 带换行符保存数据与带换行符展示数据
毕业设计进行ing~ 最近要想要实现一个站内邮箱,想要带换行地输出邮件主体内容. 这两天为了解决这个问题百度了好多东西,发现相关问题有很多记录,可能这确实是大多数初学者也碰到的问题.自己找了好多地方都 ...
- CentOS 7 个性化配置指南
博客原文地址:CentOS 7 个性化配置指南 - Wind Spirit 0x00 前言 该教程主要安装了如下软件包 iptables MySQL PHP PHP 相关模块 Nginx 主要配置实现 ...
- Ubuntu Docker版本的更新与安装
突然发现自己的docker版本特别的低,目前是1.9.1属于古董级别的了,想更新一下最新版本,这样最新的一下命令就可以被支持.研究了半天都没有更新成功,更新后的版本始终都是1.9.1 :查阅了官网资料 ...
- Solidity中uint转string
在<Solidity中uint转bytes>中,我们知道unit如何转换成bytes,其实把uint转换成string,就是在最后加上string(bytes变量)即可,如下所示: pra ...
- dotnet core 编程规范
本文实际只是翻译 .NET Core foundational libraries 官方文档的编码风格 在 .NET Core foundational libraries项目使用的编程规范默认就是 ...
- JavaScript 变量作用域 详解
变量作用域要点 - 在JavaScript中没有块级作用域,只有函数作用域 - 在函数体内,局部变量的优先级高于同名的全局变量 - 在全局作用域编写代码时可以不写var语句,但声明局部变量时必须使用v ...
- maven配置之:<distributionManagement>snapshot快照库和release发布库
在使用maven过程中,我们在开发阶段经常性的会有很多公共库处于不稳定状态,随时需要修改并发布,可能一天就要发布一次,遇到bug时,甚至一天要发布N次.我们知道,maven的依赖管理是基于版本管理的, ...
- 【Java基础】11、java方法中只有值传递,没有引用传递
public class Example { String testString = new String("good"); char[] testCharArray = {'a' ...
- Excel与minitab的不同
minitab是专业数据分析软件,可以直接通过导入数据源出结果,出图表, EXCEL的长处就是单元格可编辑,可视化强,也能做较多的分析,导入一些加载宏后功能更强大,但就分析能力而言,还 是比minit ...