nenick / AndroidStudioAndRobolectric

Minimal Robolectric and Android Studio example
139 stars 29 forks source link

BuildConfig is not by default generated for all build types #8

Open nenick opened 9 years ago

nenick commented 9 years ago

This issue is tracked at https://code.google.com/p/android/issues/detail?id=52962

Solution is to make the main project depend on different build types ... ... setting this in the dependency project

android {
    publishNonDefault true
}

and this in the project that uses it

dependencies {
    releaseCompile project(path: ':theotherproject', configuration: 'release')
    debugCompile project(path: ':theotherproject', configuration: 'debug')
}