Android data build failed after Gradle exited with plugin upgrade with transition to annotation Processor

  • To support Instant Run in my version of Android Studio, I need to upgrade the Gradle plugin from version 2.2.3to2.3.3
  • I know that I should switch to annoationProcessor , and I believe that I followed this guide correctly.
  • after that, Android DataBinding code generation is generated

The previous migration guide states that all I need is

  • Make sure you use the Android Gradle 2.2 or later plugin
  • Remove android-apt plugin from build scripts
  • Change all dependencies of apt, androidTestApt and testApt to their new format.

This should be all that is needed to successfully create a project. However, it is not built.

Create output

Gradle built with error (s) and 23 warnings (s) in 12 with 481 ms

All errors follow the same pattern:

  • C: \ Users ... \ FooAdapter.java
    • Error: package com.example.app.databindingdoes not exist
    • error: cannot find character class ItemFooBinding

An interesting message can be found in the assembly console:

. - : "[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] '

, ...

  • - XML , . XML, Git Gradle ( )
  • , , , , , "" 101 .:)

, Gradle:

, " " , :

  • Android DataBinding
  • Realm
  • ButterKnife ( ...)
  • Multidex

- , ? !

+6
3

, , Kotlin. : Java, - . .:)

, apt annotationProcessor , .

annotationProcessor, kapt, , -, Kotlin.

Gradle, , build.gradle:

  • annotationProcessor 'com.example.my.library:x.y.z
  • kapt 'com.example.my.library:x.y.z
+3

. gradle :

kapt "com.android.databinding:compiler:3.0.1"

, -

Update:
3.0.1 Android Plugin.

+7

, , , - . . - , . , . , , , . , , , , Google .

100 - , , .

, Dagger 2 , annotationProcessor; . , , , - , .

+2

All Articles