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 ...
随机推荐
- 杭州富阳场口科目四考试公交路线(西溪北苑->场口)
从西溪北苑出发,时间充裕,比较悠闲,打算坐公交前往,也打算做下科目四模拟题,顺便欣赏沿途的风景(去的时候需要看题目,回来的时候可以放松,哈哈哈),路线如下. 早上7点半出发,出去吃个早餐,步行到文一社 ...
- 从零开始学 Web 之 Ajax(五)同步异步请求,数据格式
大家好,这里是「 从零开始学 Web 系列教程 」,并在下列地址同步更新...... github:https://github.com/Daotin/Web 微信公众号:Web前端之巅 博客园:ht ...
- spring-boot-2.0.3启动源码篇五 - run方法(四)之prepareContext
前言 此系列是针对springboot的启动,旨在于和大家一起来看看springboot启动的过程中到底做了一些什么事.如果大家对springboot的源码有所研究,可以挑些自己感兴趣或者对自己有帮助 ...
- MySQL基准测试(三)--开源工具与实例演示
MySQL基准测试(三)--开源工具与实例演示 针对web应用 ab ab是一个Apache HTTP服务的基准测试工具. http_load http_load是一个针对Web服务器测试工具. JM ...
- HTML中多种空格转义字符
记录一下,空格的转义字符分为如下几种: 1. &160#;不断行的空白(1个字符宽度) 2. &8194#;半个空白(1个字符宽度) 3. &8195#;一个空白(2个 ...
- [转]微擎load()文件加载器
本文转自:https://blog.csdn.net/qq_32737755/article/details/78124534 微擎中加载文件需要用到 load() 在官网找到官方对load()的解释 ...
- RBAC 权限设计(转载)
来源 :https://blog.csdn.net/rocher88/article/details/43190743 这是我在网上找的一些设计比较好的RBAC权限管理 不知道,像新浪.搜狐.网易.百 ...
- VB.NET 窗體操作
Private Sub A1() '加载窗体 frm1.Show() End Sub Private Sub A2() '離開 Process.GetCurrentProcess().Kill() E ...
- 【Spring】13、使用Spring 3的@value简化配置文件的读取
Spring 3支持@value注解的方式获取properties文件中的配置值,大简化了读取配置文件的代码. 1.在applicationContext.xml文件中配置properties文件 & ...
- 设计模式之备忘录模式(Memento )
当我们在实际应用中需要提供撤销机制,当一个对象可能需要再后续操作中恢复其内部状态时,就需要使用备忘录模式.其本质就是对象的序列化和反序列化的过程,支持回滚操作. 作用 在不破坏封装性的前提下,捕获一个 ...