I have two modules, A and B. A added B as dependency. BuildConfig is generated in B, while being used in both A and B. No error shows in Android Studio, and the app can be installed successfully. But when making the whole project from command line, it shows the error "Cannot find symbol" on line "import com.package.b.BuildConfig". The odd thing is this only occurs on module B, but not module A. Note that the package name is correct and the app can normally run.
Module A
|____com.package.a
|____Class X
Module B
|____com.package.b
|____Class Y
|____Class Z
|____BuildConfig(generated)