Closed cristan closed 3 years ago
Check version 1.4.5
I had a similar problem (v1.4.4) and in version 1.4.5 everything works well.
Getting same issue in 1.5.8.
Getting same issue in 1.5.8.
Show me the stacktrace and the code with usage of ViewBinding in that place
Getting same issue in 1.5.8.
Show me the stacktrace and the code with usage of ViewBinding in that place
Here is the stacktrace.
Caused by: java.lang.NoSuchMethodException: com.ppm.pace365app.databinding.ActivitySignInBinding.bind [class android.view.View]
at java.lang.Class.getMethod(Class.java:2072)
at java.lang.Class.getMethod(Class.java:1693)
at by.kirich1409.viewbindingdelegate.internal.BindViewBinding.<init>(ViewBindingCache.kt:116)
at by.kirich1409.viewbindingdelegate.internal.ViewBindingCache.getBind$com_github_kirich1409_ViewBindingPropertyDelegate_core(ViewBindingCache.kt:29)
at by.kirich1409.viewbindingdelegate.ReflectionActivityViewBindings$viewBinding$2.invoke(ActivityViewBindings.kt:61)
at by.kirich1409.viewbindingdelegate.ReflectionActivityViewBindings$viewBinding$2.invoke(ActivityViewBindings.kt:60)
at by.kirich1409.viewbindingdelegate.LifecycleViewBindingProperty.getValue(ViewBindingProperty.kt:102)
at by.kirich1409.viewbindingdelegate.LifecycleViewBindingProperty.getValue(ViewBindingProperty.kt:71)
When I tried 1.4.5, it was working fine, but getting the issue in 1.5.8.
Update: Hey, just found that it is working on 1.5.6 too. But I'm still getting crash on 1.5.8.
I've just found out the problem. Will be fixed in next release. As temporary solution please add to you ProGuard config next lines
-keep,allowoptimization class * implements androidx.viewbinding.ViewBinding {
public static *** bind(android.view.View);
public static *** inflate(...);
}
-keep,allowoptimization class * implements androidx.viewbinding.ViewBinding { public static bind(android.view.View); public static inflate(...); }
This worked. Thanks
There is a similar crash in 1.5.9 as well:
Caused by: java.lang.NoSuchMethodException: my.project.databinding.MiisFragmentShowcaseBinding.bind [class android.view.View]
at java.lang.Class.getMethod(Class.java:2103)
at java.lang.Class.getMethod(Class.java:1724)
at by.kirich1409.viewbindingdelegate.internal.BindViewBinding.<init>(ViewBindingCache.kt:14)
at by.kirich1409.viewbindingdelegate.ReflectionFragmentViewBindings$viewBinding$3.invoke(FragmentViewBindings.kt:28)
at by.kirich1409.viewbindingdelegate.LifecycleViewBindingProperty.getValue(ViewBindingProperty.kt:8)
at by.kirich1409.viewbindingdelegate.FragmentViewBindingProperty.getValue(FragmentViewBindings.kt:3)
at by.kirich1409.viewbindingdelegate.FragmentViewBindingProperty.getValue(FragmentViewBindings.kt:2)
at my.project.ShowcaseFragment.getBinding(ShowcaseFragment.kt:8)
...
Adding the proguard rules helps:
-keep,allowoptimization class * implements androidx.viewbinding.ViewBinding {
public static *** bind(android.view.View);
public static *** inflate(...);
}
When I run a release build I get the following exception:
This occurs at 'com.github.kirich1409:viewbindingpropertydelegate:1.4.3' and 'com.github.kirich1409:viewbindingpropertydelegate:1.4.4'. This doesn't happen with 'com.github.kirich1409:viewbindingpropertydelegate:1.4.2' (or 'com.kirich1409.viewbindingpropertydelegate:viewbindingpropertydelegate:1.4.2').