Skip to content

Set targetSdk for tests#87

Merged
inahga merged 1 commit into
mainfrom
inahga/test-version
Jan 31, 2024
Merged

Set targetSdk for tests#87
inahga merged 1 commit into
mainfrom
inahga/test-version

Conversation

@inahga

@inahga inahga commented Jan 31, 2024

Copy link
Copy Markdown
Contributor

Instrumented tests (i.e. invoked by ./gradlew connectedCheck) would fail on Android 14 emulators:

Exception thrown during onBeforeAll invocation of plugin com.android.tools.utp.plugins.host.apkinstaller.AndroidTestApkInstallerPlugin.
Failed to install APK(s): /Users/inahga-work/Projects/divviup-android/divviup/build/outputs/apk/androidTest/debug/divviup-debug-androidTest.apk
INSTALL_FAILED_DEPRECATED_SDK_VERSION: App package must target at least SDK version 23, but found 21
com.android.ddmlib.InstallException: INSTALL_FAILED_DEPRECATED_SDK_VERSION: App package must target at least SDK version 23, but found 21
        at com.android.ddmlib.internal.DeviceImpl.installRemotePackage(DeviceImpl.java:1409)
        at com.android.ddmlib.internal.DeviceImpl.installPackage(DeviceImpl.java:1235)
...

Evidently, the minimum allowable API version for Android 14 has been raised.

Raise the API version we use in tests to 23, while still leaving the minimum supported SDK at 21.

Note: android.defaultConfig.targetSdk has been deprecated for libraries, replaced with android.testConfig.targetSdk. In the absense of either of these options, the DSL will default to using the minSdk version.

@inahga inahga requested a review from a team as a code owner January 31, 2024 01:44
@inahga inahga merged commit 59d4af5 into main Jan 31, 2024
@inahga inahga deleted the inahga/test-version branch January 31, 2024 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants