Home » Android » android – Databinding error when using different applicationID in flavor

android – Databinding error when using different applicationID in flavor

Posted by: admin May 14, 2020 Leave a comment

Questions:

After updating to Android studio 2.0 preview 2 I get following error when compiling against beta flavor which has suffix .beta:

app build.gradle:

productFlavors {
        beta {
            applicationId 'com.example.app.beta'
        }
        production {
            applicationId 'com.example.app'
        }
    }

Error:

Error:(38, 44) error: package com.example.app.databinding does not exist

When compiling against production flavor, everything is fine. The most puzzling thing is that this error occurs only when running the app (not during gradle sync)

How to&Answers: