After migrating my whole project to android x I can't get it to compile anymore.
I get 100 of following errors:
e: M:\tmp\EverywhereLauncher\app\generated\data_binding_base_class_source_out\devWithoutTestWithAccessibilityDebug\dataBindingGenBaseClassesDevWithoutTestWithAccessibilityDebug\out\com\my\app\databinding\ActivityMainBinding.java:52: error: cannot find symbol
@Nullable ViewGroup root, boolean attachToRoot, @Nullable DataBindingComponent component) {
^
symbol: class DataBindingComponent
location: class ActivityMainBinding
I don't know where to continue.
I have two problems now.
What I tried:
I have following in my projects build.gradle
to increase the number of printed errors to 10000:
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xmaxerrs" << "10000"
}
}
This always worked but in this case it does not increase the errors that are printed
Any ideas what I could do next?
Additional
I use following
android.enableJetifier=true
android.useAndroidX=true
I use android studio 3.2
, with kotlin 1.2.61
and 3.3.0-alpha01
gradle build tools
3.3.0-alpha01
gradle build tools because I also use evernote com.evernote:android-state
which does not otherwise - problem is explained here: https://github.com/evernote/android-state/issues/56
SOLUTION - increase logged erros
In the past, following was enough in the broject's build.gradle
file:
gradle.projectsEvaluated {
tasks.withType(JavaCompile.class) {
options.compilerArgs << "-Xmaxerrs" << "10000"
}
}
With kotlin, following will help:
afterEvaluate {
if (project.plugins.hasPlugin("kotlin-kapt")) {
kapt {
javacOptions {
option("-Xmaxerrs", 10000)
}
}
}
}
REAL ISSUE
In my case I converted a class from java to kotlin with some fields like following:
@Arg
Integer someValue;
The converter created following:
@Arg
internal var someValue: Int? = null
The problem:
internal
does not work with the annotation, so it failed, but the log only showed the data binding errors...
Example project build.gradle
https://gist.github.com/MFlisar/eca8ae6c2e6a619913ab05d503a4368f
I was also getting this bug after updating to androidx, tried everything suggested in a few stack overflow posts, finally updating to gradle plugin 3.3.0-beta03 worked
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With