标签:
1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:layout_width="match_parent" 4 android:layout_height="match_parent" 5 > 6 7 <TextView 8 android:layout_width="wrap_content" 9 android:layout_height="wrap_content" 10 android:text="Hello World!" 11 /> 12 13 </LinearLayout>
反例:像这个布局文件,如果要使用DataBinding的话,最外层要改成layout布局的,
但是我以为它最终要改成layout,所以我事先在加入complie和enabled代码前直接改成layout,
//DataBinding
compile "com.jakewharton.rxbinding:rxbinding:0.4.0"
compile "com.jakewharton.rxbinding:rxbinding-design:0.4.0"
compileSdkVersion 24
buildToolsVersion "24.0.0"
dataBinding {
enabled = true
}
}
导致在在加入complie和enabled代码后,点击右上角的Sync Now,一直报错
C:\android\ASWorkSpace\HighlyTechnical\tenical\build\intermediates\data-binding-layout-out\debug\layout\activity_main.xml
Error:(11) Error parsing XML: duplicate attribute
Error:Execution failed for task ‘:tenical:processDebugResources‘.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
Information:BUILD FAILED
莫名奇妙的错误。引以为戒。
标签:
原文地址:http://www.cnblogs.com/johnsonwei/p/5727771.html