Reputation: 11
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
Upvotes: 1
Views: 1876
Reputation: 378
have you resolve the issue? I was experiencing the same and found the following undocumented behaviour, see bellow
As I was testing previously devices based on Android 8.1 (SDK #27)
I had corresponding CTS and VTS tests organised under a folder, e.g. TRADFED
, then put under the same parent folder CTS for testing Android 8.0 (SDK #26)
devices and was getting the same issue with not matching SDK version.
My structure looked something like this:
--TRADFED
|-- android-cts
|-- android-cts-media-1.4
|-- android-cts-verifier
`-- android-vts_81
It turned out, that CTS were scanning the entire directory structure from its parent (TRAFED
) for the test APKs and VTS contains same Cts*.apk
under the testcases
subfolder and it was rather trying to install those from VTS rather its own CTS location.
It looks like CTS are pretty selfish and aggressive and scans the entire parent folder for any suitable Cts*.apk
apps regardless it sit in completely outside of CTS location.
Upvotes: 0