Skip to content

Commit ef53866

Browse files
Target Android 15 (API 35) for Play upload (#26)
* Target Android 15 (API 35) for Play upload and bump version code to 2 Google Play now requires new apps to target at least API level 35. Set targetSdk to 35 and compileSdk to 36 (API 35 is not installed locally; the installed platform is 36, and compileSdk may exceed targetSdk). Bump versionCode to 2 because the prior target 34 upload consumed version code 1 on the internal testing track. Suppress the AGP 8.5.0 unsupported compileSdk warning, which is non fatal. * Pin Robolectric test runtime to SDK 34 for the targetSdk 35 bump Robolectric 4.12.2 supports a maximum Android SDK of 34. Bumping targetSdk to 35 for the Play upload made every un-annotated Robolectric suite fail to initialize with targetSdkVersion=35 > maxSdkVersion=34, turning 10 Compose UI suites red. Pinning the test runtime to SDK 34 via robolectric.properties keeps the suite green while the app still ships targetSdk 35. Suite back to 483 passing, 0 failures, 4 skipped.
1 parent 2580f93 commit ef53866

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

app/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ plugins {
1010

1111
android {
1212
namespace = "com.mustafanazeer.baselinems"
13-
compileSdk = 34
13+
compileSdk = 36
1414

1515
defaultConfig {
1616
applicationId = "com.mustafanazeer.baselinems"
1717
minSdk = 31
18-
targetSdk = 34
19-
versionCode = 1
18+
targetSdk = 35
19+
versionCode = 2
2020
versionName = "0.1.0"
2121

2222
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Robolectric 4.12.2 supports a maximum Android SDK of 34. Without an explicit
2+
# pin, Robolectric defaults to the app targetSdkVersion, which is 35 for Play
3+
# upload, and refuses to initialize ("targetSdkVersion=35 > maxSdkVersion=34").
4+
# Pinning the test runtime to 34 keeps the suite green while the app still ships
5+
# targetSdk 35. Raise this only after upgrading Robolectric to a release that
6+
# ships SDK 35 shadows (4.14 or later).
7+
sdk=34

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ kotlin.code.style=official
2020
# Enables namespacing of each library's R class so that its R class includes only the
2121
# resources declared in the library itself and none from the library's dependencies,
2222
# thereby reducing the size of the R class for that library
23-
android.nonTransitiveRClass=true
23+
android.nonTransitiveRClass=true
24+
android.suppressUnsupportedCompileSdk=36

0 commit comments

Comments
 (0)