Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set targetSdk for tests #87

Merged
merged 1 commit into from
Jan 31, 2024
Merged

Set targetSdk for tests #87

merged 1 commit into from
Jan 31, 2024

Conversation

inahga
Copy link
Contributor

@inahga inahga commented Jan 31, 2024

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
3 checks passed
@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