The device has sdk with AP level 26, and the CTS test is also of level 26. But while running command > run cts-java facing error :
java.lang.RuntimeException: com.android.tradefed.targetprep.TargetSetupError: Failed to install CtsLibcoreTestCases.apk on 00002474. Reason: 'INSTALL_FAILED_OLDER_SDK: Failed parse during installPackageLI: /data/app/vmdl1133462583.tmp/base.apk (at Binary XML file line #0): Requires newer sdk version #27 (current version is #26)'
Investigation so far done :
Finding the apk version:
$ aapt dump badging ~/CTS/android-cts/testcases/CtsLibcoreTestCases.apk
package: name='android.libcore.cts' versionCode='26' versionName='8.0.0' platformBuildVersionName='8.0.0'
sdkVersion:'26'
targetSdkVersion:'26'
Finding device sdk version :
$ adb shell getprop ro.build.version.sdk
26
There is no conflict but still there is error arising. My hunch is the device or cts temp directory has stored previous apk data. I dont know how to remove it. Please suggest