Getting these errors while running project.
android.databinding.tool.util.LoggedErrorException: Found data binding errors.
*/ data binding error *msg:Cannot find the setter for attribute 'android:onClick' with parameter type lambda on android.support.v7.widget.CardView.
file: in file comment_item.xml
*\ data binding error *
*/ data binding error *msg:Cannot find the setter for attribute 'android:onClick' with parameter type lambda on android.support.v7.widget.CardView.
file:in file product_item.xml
*\ data binding error *
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
android.databinding.tool.util.LoggedErrorException: Found data binding errors.
*/ data binding error *msg:Cannot find the setter for attribute 'android:onClick' with parameter type lambda on android.widget.Button.
file:C:\android\infoskills\DemoApp\app\src\main\reslayout\activity_get_started.xml
loc:42:35 - 42:70
*\ data binding error *
android.databinding.tool.util.LoggedErrorException: Found data binding errors.
****/ data binding error ****msg:Cannot find the setter for attribute 'bind:val1' with parameter type java.lang.String on android.widget.TextView. file:/Users/myname/dev/android/project/yuxun_android/app/src/main/res/layout/activity_activity_detail.xml loc:99:41 - 99:56 ****\ data binding error ****
My custom adapter code:
@BindingAdapter({"val1", "val2"})
public static void setFormatTextStyle(TextView textView, String val1, String val2) {...}
I am constantly getting these errors on almost every call like this
android:onClick="@{() -> viewModel.performClickEvent()}"
It is incredibly frustrating. The only solution is to comment out every click binding and uncomment them, rebuilding at each one, and this only works part of the time. Really need a fix for this.
Error:java.lang.IllegalStateException: failed to analyze: android.databinding.tool.util.LoggedErrorException: Found data binding errors.
*/ data binding error *msg:Cannot find the setter for attribute 'android:onClick' with parameter type lambda on android.support.v7.widget.CardView. file:/Users/cyberpunk/dev/android/projects/MyApp/app/src/main/res/layout/activity_create_item.xml loc:142:35 - 142:69 *\ data binding error *
at org.jetbrains.kotlin.analyzer.AnalysisResult.throwIfError(AnalysisResult.kt:57)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules(KotlinToJVMBytecodeCompiler.kt:137)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:158)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:61)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:107)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:51)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:92)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$2.invoke(CompileServiceImpl.kt:386)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$2.invoke(CompileServiceImpl.kt:96)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:892)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:96)
at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:919)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:891)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:385)
at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
@dcalano https://issuetracker.google.com/issues/70915745#comment8 might fix it (for now)
@jush No fix for me, but I left a comment on the thread, thank you for the link.
I have face with this problem.
So my solution is Change to Project View-> Remove .Gradle and .idea folder -> Rebuild project -> Done
What helped me is making sure that in app gradle file I have
implementation 'com.android.support:cardview-v7:27.1.0'
implementation 'com.android.support:support-v4:27.1.0'
The samples compile fine. Please file issues against DataBinding on the issue tracker if you're still having issues.
Most helpful comment
I have face with this problem.
So my solution is Change to Project View-> Remove .Gradle and .idea folder -> Rebuild project -> Done