2.2.3
to 2.3.3
The migration guide linked earlier states that all I need is to
- Make sure you are on the Android Gradle 2.2 plugin or newer
- Remove the android-apt plugin from your build scripts
- Change all apt, androidTestApt and testApt dependencies to their new format
This should be all that's needed to successfully build the project. Yet it doesn't build.
Gradle build finished with 101 error(s) and 23 warning(s) in 12s 481ms
All of the errors follow the same pattern:
- C:\Users...\FooAdapter.java
- error: package
com.example.app.databinding
does not exist- error: cannot find symbol class
ItemFooBinding
An interesting message can be found in the build console:
Warning:The following options were not recognized by any processor: '[android.databinding.minApi, android.databinding.enableDebugLogs, android.databinding.sdkDir, android.databinding.bindingBuildFolder, android.databinding.enableForTests, android.databinding.modulePackage, android.databinding.generationalFileOutDir, android.databinding.xmlOutDir, android.databinding.artifactType, android.databinding.printEncodedErrors, android.databinding.isTestVariant]'
I would like to point out that...
The following diffs show how I've modified my gradle files:
build.gradle
DiffChecker linkapp/build.gradle
DiffChecker linkAlso, as a quick overview, here is the list of some of the "more interesting" plugins & libraries used by the project:
Does anyone have a clue what could be the issue? Any help or idea will be greatly apprecitated!
It seems it all comes down to my project using Kotlin. Actually we have it mixed: some classes use plain old Java while others are written in Kotlin. An incomplete migration. :)
I assume that without Kotlin, replacing apt
with annotationProcessor
would be enough and I wouldn't have ran into this issue at all.
Annotations need to be processed by both annotationProcessor
and kapt
, which seems to be Kotlin's own annotation processor.
For each Gradle dependency that uses annotations, you should have both of the following in your app-level build.gradle
:
annotationProcessor 'com.example.my.library:x.y.z
kapt 'com.example.my.library:x.y.z