Since the update to Android Studio 3.2.0
I face the following issue:
Execution failed for task ':mobile:dataBindingGenBaseClassesDebug'.
> couldn't make a guess for com.ACME.database.model.Order
also seen this answer, which hints for that "package-names must start with a lower-case letter".
... it seems alike, as if this variable
assignment would be the cause:
<data class=".databinding.OrderFragmentBinding">
<variable name="order" type="com.ACME.database.model.Order"/>
...
</data>
found: New data binding compiler for binding classes, which does not explain the change in behavior.
Q: are such assignments also affected by that naming convention? I mean, is there any chance (beside changing the uppercase package-name) to make that data-binding v2 "guess" work out?
Same thing happening to me after updating to 3.2 (working application before the migration, and no code change)... then this "guess" issue even though I do have lowercase in the first letters of the package name!
So I "guess" your issue will still remain even after you update the package name (which is best practice anyways, given issues appear every single time I upgrade Android Studio!).
Anyway, I solved by downgrading the v2 databinding in gradle.properties (you'll get an "unsupported" warning, but just ignore it):
Looks like the Android Studio PG hasn't tested that well this assertion (here):
Data Binding V2 is now enabled by default and is compatible with V1.
these settings in the
gradle.properties
do enable theandroidx
data-binding compiler:one can see that by the fetched package:
and it complains:
most likely
androidx.fragment.app.Fragment
instead ofandroid.support.v4.app.Fragment
would be required, in order to data-bind aFragment
with the default v2 data-binding compiler. this is also just a temporary solution - but still better than to revert to the v1 data-binding compiler.