Skip to content

Commit 123768c

Browse files
committed
Force compileSdkVersion 36 on all dependencies
1 parent 08eb7ec commit 123768c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

android/build.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@ subprojects {
1313
project.evaluationDependsOn(':app')
1414
}
1515

16+
// Force compileSdkVersion and targetSdkVersion for all Android library/app projects
17+
subprojects {
18+
afterEvaluate { project ->
19+
if (project.plugins.hasPlugin('com.android.library') || project.plugins.hasPlugin('com.android.application')) {
20+
try {
21+
project.android.compileSdkVersion = 36
22+
// also set targetSdkVersion where available
23+
if (project.android.defaultConfig != null) {
24+
project.android.defaultConfig.targetSdk = 36
25+
}
26+
} catch (e) {
27+
// fail-safe: some subprojects may not expose android DSL in time — ignore
28+
logger.debug("Could not force compileSdk/targetSdk for project ${project.name}: ${e.message}")
29+
}
30+
}
31+
}
32+
}
33+
1634
tasks.register("clean", Delete) {
1735
delete rootProject.buildDir
1836
}

0 commit comments

Comments
 (0)