I\'m trying to use data-binding with Android.
I can not anymore build my project. I got this error :
\"Error:(13, 46) error: package ch.compan
Thanks to Yigit!
The issue was not directly link to Android Databinding. There were a bug in the project (some variables not correctly setted)
I would recommend to use gradle with "--debug and --stacktrace" for more informations, it's helping a lot.
if you tried this steps
android.databinding.enableV2=false
android.enableExperimentalFeatureDatabinding=true
and checking all xml files looks good. then you should go with this solution, add below code in project level build.gradle
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xmaxerrs" << "1000"
}
}
}
this will give you exact error where you have actual error explanation: above code will increase the size of the compile error
Package name should start with small letter. for example Activities is wrong it'll give an error instead refactor->rename to activities
On my particular case, I was using Dagger 2. This package error appears in a lot of classes without any relation with the original error: a dependency injection error.
Happy reminder: Scroll more on your stacktrace to know what is the real problem.
Make sure your package name start with lowercase letter. in my case issue solved after two hours of struggle
Make sure your model's fields you reference in layout have public
access modifiers