Skip to content

Commit bc75bf0

Browse files
committed
Update gradle
1 parent 17e9c72 commit bc75bf0

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

android/build.gradle

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,21 @@ subprojects { project ->
1919
// helper to configure Android DSL safely
2020
def configureAndroid = { p ->
2121
try {
22-
p.android.compileSdkVersion = 36
23-
// also set targetSdkVersion where available
22+
// Support both older and newer AGP DSLs by attempting both properties.
23+
try {
24+
p.android.compileSdk = 36
25+
} catch (ignored) {
26+
// fallback for older AGP
27+
p.android.compileSdkVersion = 36
28+
}
29+
30+
// also set targetSdk / targetSdkVersion where available
2431
if (p.android.defaultConfig != null) {
25-
p.android.defaultConfig.targetSdk = 36
32+
try {
33+
p.android.defaultConfig.targetSdk = 36
34+
} catch (ignored2) {
35+
p.android.defaultConfig.targetSdkVersion = 36
36+
}
2637
}
2738
} catch (e) {
2839
// fail-safe: some subprojects may not expose android DSL in time — ignore

0 commit comments

Comments
 (0)