Status Update
Comments
uc...@google.com <uc...@google.com>
da...@google.com <da...@google.com> #2
Did you apply kotlin-kapt?
v....@open-bs.ru <v....@open-bs.ru> #3
da...@google.com <da...@google.com> #4
Matthew, I think this is the exact same thing you were seeing? An update in kapt may be totally breaking data binding for Kotlin users. This seems like a P0 to me but I'm not sure what I can do, since our code hasn't changed at all.
Hung, in case you're not aware, it seems like something has changed between canary 4 and canary 5 which causes kapt not to work for data binding. Maybe it was an AGP change?
Hung/Yigit, we should really dig into how our tests didn't catch this.
da...@google.com <da...@google.com> #5
OP, just to make sure, you're writing Kotlin yeah? I'm assuming it's that. Or are you seeing this in Java as well?
da...@google.com <da...@google.com> #6
Repro steps for anyone who wants to see this for themselves:
- git clone
https://github.com/chrisbanes/tivi - In buildSrc/src/main/java/app/tivi/buildsrc/dependencies.kt, upgrade AGP:
const val androidGradlePlugin = "com.android.tools.build:gradle:4.2.0-alpha05
- In root
gradle.properties
, update heap settings and add fake properties just to get things to compile:org.gradle.jvmargs=-Xmx2048m
(bumped up from 1536m)- Add to the end of the file (values don't really matter):
TIVI_TRAKT_CLIENT_ID=1234 TIVI_TRAKT_CLIENT_SECRET=5678 TIVI_TMDB_API_KEY=abcd
- Build
app
. You may need to add--stacktrace
to your gradle options (this won't be necessary after lands)https://issuetracker.google.com/156837289 - Notice all the failures. These are caused because the project's
@BindingAdapter
annotations are being lost.
da...@google.com <da...@google.com> #7
Hung, kicking to you initially in case this is a Gradle change you're aware of. Kick back to me if you have no idea what is going on here, and I'll escalate locally.
yb...@google.com <yb...@google.com> #8
i'm looking into reproducing it. we do have tests where adapters from sub modules are used so it is scary how this got missed. also didn't change anything in data binding :/.
yb...@google.com <yb...@google.com> #9
i'mlooking into this in between meetings so a bit slow but initial findings:
➜ tivi git:(main) ✗ find ./common-databinding/build/intermediates/data_binding_artifact/ -name "*.json"|grep -i setter
./common-databinding/build/intermediates/data_binding_artifact/debug/app.tivi.common.databinding-setter_store.json
➜ tivi git:(main) ✗ find ./common-layouts/build/intermediates/data_binding_dependency_artifacts/ -name "*.json"|grep -i setter
./common-layouts/build/intermediates/data_binding_dependency_artifacts/debug/com.airbnb.epoxy.databinding-setter_store.json
./common-layouts/build/intermediates/data_binding_dependency_artifacts/debug/dev.chrisbanes.insetter.dbx-setter_store.json
./common-layouts/build/intermediates/data_binding_dependency_artifacts/debug/androidx.databinding.library.baseAdapters-setter_store.json
seems like setter store (the output of parsing binding adapters) is generated for common-databinding but it is not copied into the layouts project.
meanwhile, dependencies from gradle outputs are copied.
Hung, did anything change there?
yb...@google.com <yb...@google.com> #10
also reproduces with tip of tree.
hu...@google.com <hu...@google.com> #11
yb...@google.com <yb...@google.com> #12
also our mutli module test is passing so nothing is broken in the infra as well.
the difference is that, that test is in java :/. i'll try adding a kotlin module there to see if it helps reproduce.
hu...@google.com <hu...@google.com> #13
Yup, the above change only impacts modules that use Kapt.
yb...@google.com <yb...@google.com> #15
more info:
The merge artifacts task is not seeing the artifacts provided by the dependency.
task.runtimeDependencies = creationConfig.variantDependencies.getArtifactFileCollection(
AndroidArtifacts.ConsumedConfigType.RUNTIME_CLASSPATH,
AndroidArtifacts.ArtifactScope.ALL,
AndroidArtifacts.ArtifactType.DATA_BINDING_ARTIFACT
)
task.compileTimeDependencies = creationConfig.variantDependencies.getArtifactFileCollection(
AndroidArtifacts.ConsumedConfigType.COMPILE_CLASSPATH,
AndroidArtifacts.ArtifactScope.ALL,
AndroidArtifacts.ArtifactType.DATA_BINDING_ARTIFACT
)
the getArtifactFileCollection
does not return anything from module dependencies that are in the same project.
I see some changes in that area by jedo@ but i'm not sure if any of them would trigger this.
yb...@google.com <yb...@google.com> #16
Ivan / Hung, Jedo said you might have an idea what is broken here.
To reproduce:
checkout the CL above in tools/data-binding
cd tools/base && ./gradlew :pL :makeOfflineRepo
cd ../data-binding
./init.sh # this just makes test projects use latest gradle
cd integration-tests/KotlinTestApp
./gradlew app:connectedCheck -Pandroid.injected.invoked.from.ide=true
# invoked from ide is important, otherwise they'll assume gradle connected check runner setup
You can put a debug point on DataBindingMergeDependencyArtifactsTask
and observe that the artifacts from the module do not show up.
hu...@google.com <hu...@google.com> #17
Yup I've found the root cause (
hu...@google.com <hu...@google.com> #18
I've sent out a fix for review: Change-Id: I3ed5520fc33184475a42c19d19412a87cb2d386d
hu...@google.com <hu...@google.com> #19
We have fixed this issue:
I'm trying to cherry-pick the fix to AGP 4.2.0-alpha06, otherwise it will probably be in 4.2.0-alpha07.
Thanks a lot for the report!
an...@google.com <an...@google.com> #20
The following changes were cherrypicked through
Release Track:
Changes: ag/12219788
Description
Studio Build:
Version of Gradle Plugin: 4.2.0-alptha05
Version of Gradle: 6.6-rc2
Version of Java: 1.14.1
OS: Windowsx64
Steps to Reproduce:
1. Create separate adroid library with kotlin object. Objet have @JvmStatic @BindingConversion and Adapters. After updtae databinodng in other modules that use this Conversions and Adapterds does not work!
And i can change gradle plugin to 04. Work stopped :(