Status Update
Comments
ag...@squareup.com <ag...@squareup.com> #2
I created the issue after reverting the plugin to version to 3.5.0 so please don't get confused with the version include above by Android Studio > Submit Feedback, I forgot to update that.
an...@gmail.com <an...@gmail.com> #3
I'm not sure whether my issue is related, or whether I should log it as a separate issue, but I get a build error when going from 3.5.0 to 3.5.1 (only change in project is changing 0 to 1):
[databinding] {"msg":"Cannot find a setter for [...].LoadingStateBinding app:state\u003e that accepts parameter type \u0027androidx.lifecycle.LiveData\u003c[...].UiState\u003cjava.lang.Boolean\u003e\u003e\u0027\n\nIf a binding adapter provides the setter, check that the adapter is annotated correctly and that the parameter type matches.","file":"[path]\\res\\layout\\export_fragment.xml","pos":[{"line0":65,"col0":25,"line1":65,"col1":34}]}
Just changing the last digit from 1 to 0 and the project builds and runs.
I've also experience the issue going to 3.6.0 Beta 1.
I checked my version control if there are any other inadvertent changes, and there are not.
Android Studio 3.5.1
Build #AI-191.8026.42.35.5900203, built on September 25, 2019
JRE: 1.8.0_202-release-1483-b03 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
[databinding] {"msg":"Cannot find a setter for [...].LoadingStateBinding app:state\u003e that accepts parameter type \u0027androidx.lifecycle.LiveData\u003c[...].UiState\u003cjava.lang.Boolean\u003e\u003e\u0027\n\nIf a binding adapter provides the setter, check that the adapter is annotated correctly and that the parameter type matches.","file":"[path]\\res\\layout\\export_fragment.xml","pos":[{"line0":65,"col0":25,"line1":65,"col1":34}]}
Just changing the last digit from 1 to 0 and the project builds and runs.
I've also experience the issue going to 3.6.0 Beta 1.
I checked my version control if there are any other inadvertent changes, and there are not.
Android Studio 3.5.1
Build #AI-191.8026.42.35.5900203, built on September 25, 2019
JRE: 1.8.0_202-release-1483-b03 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
sp...@google.com <sp...@google.com> #4
Assigning to jedo because I"m not sure who's best to take a look.
Note: This is *not* broken in 3.5.0, just 3.5.1
Note: This is *not* broken in 3.5.0, just 3.5.1
ag...@squareup.com <ag...@squareup.com> #6
This is still an issue with 3.6.0-RC1, not sure if this fix will only be available on 4.0 ?
Description
AI-191.8026.42.35.5900203, JRE 1.8.0_202-release-1483-b49-5587405x64 JetBrains s.r.o, OS Mac OS X(x86_64) v10.14.6, screens 3440x1440
AS: 3.5.1; Android Gradle Plugin: 3.5.0; Gradle: 5.6; NDK: from local.properties: 20.0.5594570, latest from SDK: 20.0.5594570; LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
class MyClassA{
val label: String
}
abstract class AbstractViewModel<out G : MyClassA>(val data: G) {
}
class Foo : MyClassA{
}
class MyViewModel(data : Foo) : AbstractViewModel<Foo>( data) {
}
xml :
<variable
name="viewModel"
type="AbstractViewModel" />
<TextView
android:text="@{viewModel.data.label}"
/>
Databinding could not determine that data is type of MyClassA and complains that label is not found in data variable.
NOTE : I have omitted unreleted code intentionally, my actual application has this scenario which I tried to picture here.
This doesn't compile in 3.5.1 but works fine with old versions till 3.5.0 .
IMPORTANT: Please read