0

I'm getting this annoying error when I've updated to Android Studio 3.2.1 (Stable)

Although not all of the binding files were affected, only some of them. I've checked out tutorials on data binding and also this link : Cannot find symbol DataBindingComponent on Android Studio 3.2 Canary 16 Kotlin project

But I wasn't able to find a solution, I created handlers for methods, set dataBinding to 'true' in the app gradle, also added annotationProcessor "android.databinding:databinding-compiler:3.2.0-alpha10"

I'm using Java (not Kotlin) in my project. And my project uses the 'inflate' and 'setContentView' from the DataBinding class (without the DataBindingComponent option) but it still says cannot find symbol class DataBindingComponent

Example :

 @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    SPManager.save(this, SPManager.kIsChatActivityOpened, true);

    binding = DataBindingUtil.setContentView(this, R.layout.activity_chat);
    viewModel = new ChatActivityViewModel(binding, this);
    binding.setViewModel(viewModel);

Been stuck on this for awhile now and I can't get on with the project because I can't even build it.

Error :

{file path}.java:307: error: cannot find symbol
  @Nullable DataBindingComponent component) {
            ^ symbol:   class MyClass location: class MyBinding

Need help

1 Answer 1

1

Do you use the Room Architectue Component as well?

I recently got the same error. First I thought it was a databinding issue, but then I figured out, that it was an error connected to the Room Architecture Component.

I have a class annotated as entity and added a field value, but forgot to provide getter and setter method for this. After i have done this, the error was gone.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.