0

After upgrading to classpath 'com.android.tools.build:gradle:2.3.0' and migrating to build-in annotation processor I got following error for all my DataBinding generated classes:

  :app:compileInternalDebugJavaWithJavac
  E:\Projects\Work-projects\mediteo-android\app\src\main\java\com\mediteo\mobile\presentation\daily\intake\adapter\DailyIntakeItem.java:18: error: package com.mediteo.mobile.databinding does not exist
  import com.mediteo.mobile.databinding.DailyIntakeHeaderItemBinding;
                                 ^
  E:\Projects\Work-projects\mediteo-android\app\src\main\java\com\mediteo\mobile\presentation\daily\intake\adapter\DailyIntakeItem.java:19: error: package com.mediteo.mobile.databinding does not exist
  import com.mediteo.mobile.databinding.DailyIntakeItemBinding;
  ........
  Error:A default public constructor with no argument must be declared in IntakeLocal if a custom constructor is declared.
  * What went wrong:
  Execution failed for task ':app:compileInternalDebugJavaWithJavac'.
  > Compilation failed; see the compiler error output for details.

However I can navigate to those files in Android studio IDE

  public class DailyIntakeHeaderItemBinding extends android.databinding.ViewDataBinding  { 
  ........
yennsarah
  • 5,467
  • 2
  • 27
  • 48
Roman Nazarevych
  • 7,513
  • 4
  • 62
  • 67

3 Answers3

0

Try invalidate caches/restart. Or may be clean build.

Karu
  • 935
  • 2
  • 13
  • 32
0

For me the problem was in new annotation processing command annotationProcessor it is worth to pay attention to all libraries that used apt (now annotationProcessor) The root cause was Error:A default public constructor with no argument must be declared in IntakeLocal if a custom constructor is declared., this is error throw by dagger.

To fix this I have to update lombok to latest version: org.projectlombok:lombok:1.16.14

Roman Nazarevych
  • 7,513
  • 4
  • 62
  • 67
0

I had the same error and could fix it by adding this to the app build.gradle dependencies:

apt 'com.android.databinding:compiler:2.3.0'
Christoph Mayr
  • 347
  • 3
  • 17