2

After I updated to Android Studio 3.0 Beta 2 and bumped build tools and support library to 26.0.1 with compile and target sdk versions set to 26 passing variables to included layouts is no longer working.

The following code was working before but is no longer working:

<include
    android:id="@+id/list_empty_layout"
    layout="@layout/empty_list_state_layout"
    app:viewModel="@{viewModel.listStateViewModel}" />

In my included layout I have the following

<data>
    <variable
        name="viewModel"
        type="viewmodels.BaseListStateViewModel" />
</data>

As I said, this was working before with build tools 25.0.3
Anyone have the same problem?

Edit:
I also forgot to mention that I updated the android gradle plugin to the following

classpath 'com.android.tools.build:gradle:3.0.0-beta2'

1 Answer 1

1

Its important to

invalidate the cache and restart

after you have a full

clean

Its a common bug using databinding.

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

2 Comments

Hey, thanks for answering, but this does not help. Tried this several times to no avail. I realise now though that I forgot to write that I also updated the android gradle plugin to 3.0.0-beta2
Did you check the generated code? Maybe since upgrading you've a syntax error somewhere in your layouts

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.