Lint errors with 1.1.0 related to Java version

#129 · closed · 3 comments

View on GitHub ↗

GrahamBorland

When I run Android Lint on my code, I get this error with FlowBinding 1.1.0. It works with 1.0.0. ``` > Task :app:kaptStagingReleaseKotlin /path/to/SomeFragment.java:69: error: cannot access LayoutChangeEvent private final void handleRecyclerViewBottomChange(reactivecircus.flowbinding.android.view.LayoutChangeEvent event) { ^ bad class file: /Users/graham/.gradle/caches/transforms-3/a5f9611dd5c277a906f0dc6820dfc2bd/transformed/jetified-flowbinding-android-1.1.0-api.jar(reactivecircus/flowbinding/android/view/LayoutChangeEvent.class class file has wrong version 55.0, should be 52.0 Please remove or make sure it appears in the correct subdirectory of the classpath. > Task :app:kaptStagingReleaseKotlin FAILED FAILURE: Build failed with an exception. ``` The code appears to compile and run correctly; it's just a Lint error. I have these build options: ```groovy compileOptions { coreLibraryDesugaringEnabled true sourceCompatibility 1.8 targetCompatibility 1.8 } kotlinOptions { jvmTarget = '1.8' } ```

Comments

ychescale9

It's probably because the library is targeting Java 11 which is now supported by AGP. Which version of Android Gradle Plugin are you using? are you able to upgrade to Java 11? We can change it back to Java 8 but AGP 7 will required JDK 11+ for building anyway.

GrahamBorland

AGP 4.2.1 at the moment, which is the latest stable version. I'll investigate targeting Java 11, thanks.

GrahamBorland

Confirmed it works now when building with Java 11.