@@ -52,6 +52,16 @@ android {
5252 )
5353 }
5454 }
55+ flavorDimensions + = " uiFramework"
56+ productFlavors {
57+ create(" compose" ) {
58+ dimension = " uiFramework"
59+ }
60+ create(" noCompose" ) {
61+ dimension = " uiFramework"
62+ applicationIdSuffix = " .nocompose"
63+ }
64+ }
5565 compileOptions {
5666 sourceCompatibility = JavaVersion .VERSION_11
5767 targetCompatibility = JavaVersion .VERSION_11
@@ -103,29 +113,34 @@ dependencies {
103113 implementation(" androidx.recyclerview:recyclerview:1.3.2" )
104114 implementation(libs.androidx.core.ktx)
105115 implementation(libs.androidx.lifecycle.runtime.ktx)
106- implementation(libs.androidx.activity.compose)
116+
117+ // Compose runtime is needed by the Kotlin Compose compiler plugin (applied project-wide).
118+ // It does NOT contain any UI classes like AbstractComposeView, so the SDK's
119+ // isComposeAvailable runtime check still returns false in the noCompose variant.
107120 implementation(platform(libs.androidx.compose.bom))
108- implementation(libs.androidx.ui)
109- implementation(libs.androidx.ui.graphics)
110- implementation(libs.androidx.ui.tooling.preview)
111- implementation(libs.androidx.material3)
121+ implementation(" androidx.compose.runtime:runtime" )
122+
123+ // Compose UI dependencies -- only for the compose flavor
124+ " composeImplementation" (libs.androidx.activity.compose)
125+ " composeImplementation" (libs.androidx.ui)
126+ " composeImplementation" (libs.androidx.ui.graphics)
127+ " composeImplementation" (libs.androidx.ui.tooling.preview)
128+ " composeImplementation" (libs.androidx.material3)
129+
130+ // noCompose uses AppCompatActivity for proper Material Components theme resolution
131+ " noComposeImplementation" (" androidx.appcompat:appcompat:1.7.0" )
112132
113133 testImplementation(libs.junit)
114- testImplementation(libs.androidx.ui.test.junit4)
115134 testImplementation(libs.core.ktx)
116135 testImplementation(libs.robolectric)
117136 testImplementation(" com.squareup.okhttp3:mockwebserver:4.12.0" )
118137 testImplementation(" io.opentelemetry:opentelemetry-sdk-testing:1.51.0" )
138+ testImplementation(" org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2" )
119139 testImplementation(testFixtures(project(" :observability-android" )))
120140
121141 // Used for testing webviews masking
122142 implementation(" org.mozilla.geckoview:geckoview:130.0.20240913135723" )
123143
124144 androidTestImplementation(libs.androidx.junit)
125145 androidTestImplementation(libs.androidx.espresso.core)
126- androidTestImplementation(platform(libs.androidx.compose.bom))
127- androidTestImplementation(libs.androidx.ui.test.junit4)
128-
129- debugImplementation(libs.androidx.ui.tooling)
130- debugImplementation(libs.androidx.ui.test.manifest)
131146}
0 commit comments