Open ghost opened 3 years ago
Workaround
As I really didn't want to go back to vanilla Compose (and thus be forced to go to Android Studio 4.2), I was searching for a workaround, until with some help from my team I found that this fixes the problem:
android {
// ...
buildTypes {
create("staging") {
initWith(getByName("debug"))
matchingFallbacks.add("debug") // <== adding this config makes the staging build type work as expected!
applicationIdSuffix = ".staging"
// ...
}
}
}
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
I'm currently working on a project that is very close to the Jetpack Compose multi-platform template generated by IDEA, everything was working fine until I tried to create a new android build type.
The relevant Gradle configuration looks like this:
With this config,
debug
andrelease
build types work fine, but when Gradle is trying to build thestaging
one, some things started to fail, like this:After further investigation, I realised that anything that is platform-specific (in this case, included by the
org.jetbrains.compose.ui:ui-android-debug
as opposed to justorg.jetbrains.compose.ui:ui
) can't be found by the compiler. Same error happens for other components likeAndroidView
, for example.My guess is that
*-android-*
dependencies are not being included in the classpath for custom build types.