1

I tried to update a project today to Gradle 4.4 and when I tried to run I get the following error output:

/Users/marianpavel/Documents/GitHub/jurnaldebord/app/build/generated/source/dataBinding/baseClasses/Devel/debug/ro/marianpavel/jurnaldebord/databinding/ActivityCreateCarBinding.java:17: error: cannot find symbol
import ro.marianpavel.jurnaldebord.ViewModels;
                                  ^
  symbol:   class ViewModels
  location: package ro.marianpavel.jurnaldebord
/Users/marianpavel/Documents/GitHub/jurnaldebord/app/build/generated/source/dataBinding/baseClasses/Devel/debug/ro/marianpavel/jurnaldebord/databinding/ActivityCreateCarBinding.java:57: error: package ViewModels does not exist
  protected ViewModels.CreateCarPresenter mPresenter;
                      ^
/Users/marianpavel/Documents/GitHub/jurnaldebord/app/build/generated/source/dataBinding/baseClasses/Devel/debug/ro/marianpavel/jurnaldebord/databinding/ActivityCreateCarBinding.java:78: error: package ViewModels does not exist
  public abstract void setPresenter(@Nullable ViewModels.CreateCarPresenter presenter);
                                                        ^
/Users/marianpavel/Documents/GitHub/jurnaldebord/app/build/generated/source/dataBinding/baseClasses/Devel/debug/ro/marianpavel/jurnaldebord/databinding/ActivityCreateCarBinding.java:81: error: package ViewModels does not exist
  public ViewModels.CreateCarPresenter getPresenter() {
                   ^
4 errors
2 warnings
:app:compileDevelDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDevelDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s

Build Tools Version : buildToolsVersion "27.0.3"

My graddle-wrapper.properties:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

What I have tried until now:

Invalidate Cache & Restart
Clean Project
Build Project.
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Marian Pavel
  • 2,726
  • 8
  • 29
  • 65
  • `import ro.marianpavel.jurnaldebord.ViewModels` is that file exist? – mahendri Mar 29 '18 at 10:45
  • Yes, that's a folder with 2 classes in it. – Marian Pavel Mar 29 '18 at 10:52
  • Android Data-Binding could be trouble at times. I had similar issue (Not the exact same) when I started using Room with Databinding. Please check my answer https://stackoverflow.com/questions/48356496/room-annotation-processor-with-data-binding/48379815#48379815 and I hope it helps. – xrnd Mar 29 '18 at 11:52
  • Have the same issue – Rifat Jun 03 '21 at 05:10

0 Answers0