Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Binding Compiler V2 #466

Closed
iMvBremen opened this issue Jul 9, 2018 · 3 comments
Closed

Data Binding Compiler V2 #466

iMvBremen opened this issue Jul 9, 2018 · 3 comments

Comments

@iMvBremen
Copy link

As can be seen right here, Android Studio 3.1 supports the Data Binding Compiler V2.

When testing Epoxy with this new compiler, the build fails saying "error: cannot find symbol class DataBinderMapperImpl".

Is it possible for a future version of Epoxy to support this new compiler?

@elihart
Copy link
Contributor

elihart commented Jul 9, 2018

I think it should be possible for Epoxy to support the new compiler, but I haven't looked into it extensively yet. It seems like the generated binding classes are now created by the gradle plugin instead of via an annotation processor.

As long as they are available to be looked up in the annotation processor it should be fine, but I probably don't have time to investigate this right now, at least until the new compiler is stable.

If anyone else wants to look into this I can help with guidance

@iMvBremen
Copy link
Author

Thanks for the answer. I've looked into this a bit today and it looks like all that is needed to make this work is a define in gradle.properties. The define being android.databinding.enableV2=true.

If anyone is interested in using the new compiler in their own project until it is actually stable and added to Epoxy, here are the steps:

  1. Clone the Epoxy git
  2. Add android.databinding.enableV2=true to the gradle.properties file
  3. Build the epoxy-databinding module: Build > Make Module 'epoxy-databinding'
  4. Add the .AAR Package to your own project: File > New Module > Import .JAR/.AAR Package > ../epoxy/epoxy-databinding/build/outputs/aar/epoxy-databinding-release.aar
  5. Add implementation project(':epoxy-databinding-release') to your build.gradle (Obviously replacing implementation 'com.airbnb.android:epoxy-databinding:2.14.0')

I have not extensively tested this, but it seems to work just fine for as far as I can see.

@elihart
Copy link
Contributor

elihart commented Jul 10, 2018

Good to hear, thanks for the update! It sounds like once the new compiler is officially enabled as the default it will work just fine with Epoxy with no changes.

I'll just have to make sure this project is updated to the latest AGP version once 3.2 is released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants