【CTS】Android CTS测试报错:AaptParser failed for file CtsCameraTestCases.apk. The APK won‘t be installed
原因是aapt2版本较低,和编译CTS apk的版本不匹配导致,替换新版本aapt2工具后问题解决。
·
运行Andorid 16 CTS套件执行测试时,aapt2报错导致测试跑不起来:
E/ModuleDefinition: AaptParser failed for file CtsCameraTestCases.apk. The APK won’t be installed
com.android.tradefed.targetprep.TargetSetupError[AAPT_PARSER_FAILED|520050|DEPENDENCY_ISSUE]: AaptParser failed for file CtsCameraTestCases.apk. The APK won’t be installed
完整报错log如下:
01-15 00:10:13 E/AaptParser: aapt2 dump badging stderr: E/ (16856): Entry offset at index 0 points outside the Type's boundaries
E/ (16856): Index 1 points to entry with unaligned offset 0x0015000e
E/ (16856): Entry offset at index 2 points outside the Type's boundaries
E/ (16856): Entry offset at index 3 points outside the Type's boundaries
E/ (16856): Index 4 points to entry with unaligned offset 0x00480041
E/ (16856): Index 5 points to entry with unaligned offset 0x005c004f
E/ (16856): Index 6 points to entry with unaligned offset 0x006a0063
E/ (16856): Index 7 points to entry with unaligned offset 0x00780071
E/ (16856): Index 8 points to entry with unaligned offset 0x0086007f
E/ (16856): Entry offset at index 9 points outside the Type's boundaries
E/ (16856): Index 12 points to entry with unaligned offset 0x00000001
E/ (16856): Entry offset at index 13 points outside the Type's boundaries
E/ (16856): Entry offset at index 14 points outside the Type's boundaries
E/ (16856): Entry at index 15 is too small (1)
E/ (16856): Entry offset at index 16 points outside the Type's boundaries
E/ (16856): Index 17 points to entry with unaligned offset 0x00000001
E/ (16856): Entry offset at index 0 points outside the Type's boundaries
E/ (16856): Entry offset at index 1 points outside the Type's boundaries
E/ (16856): Entry offset at index 2 points outside the Type's boundaries
E/ (16856): Index 3 points to entry with unaligned offset 0x1c080012
E/ (16856): Entry offset at index 4 points outside the Type's boundaries
E/ (16856): Index 5 points to entry with unaligned offset 0x1c080013
E/ (16856): Entry offset at index 0 points outside the Type's boundaries
E/ (16856): Entry offset at index 1 points outside the Type's boundaries
E/ (16856): Entry offset at index 2 points outside the Type's boundaries
E/ (16856): Entry offset at index 3 points outside the Type's boundaries
E/ (16856): Entry offset at index 4 points outside the Type's boundaries
E/ (16856): Entry offset at index 5 points outside the Type's boundaries
E/ (16856): Entry offset at index 6 points outside the Type's boundaries
E/ (16856): Entry offset at index 7 points outside the Type's boundaries
E/ (16856): Entry offset at index 8 points outside the Type's boundaries
E/ (16856): Entry offset at index 9 points outside the Type's boundaries
E/ (16856): Entry offset at index 10 points outside the Type's boundaries
E/ (16856): Entry offset at index 11 points outside the Type's boundaries
E/ (16856): Index 12 points to entry with unaligned offset 0x00000401
E/ (16856): Index 13 points to entry with unaligned offset 0x05080019
E/ (16856): Index 14 points to entry with unaligned offset 0x00000601
E/ (16856): Index 15 points to entry with unaligned offset 0x0508001a
E/ (16856): Index 16 points to entry with unaligned offset 0x00000801
E/ (16856): Index 17 points to entry with unaligned offset 0x0508001b
E/ (16856): Index 18 points to entry with unaligned offset 0x00000401
E/ (16856): Entry offset at index 19 points outside the Type's boundaries
E/ (16856): Index 20 points to entry with unaligned offset 0x00000201
E/ (16856): Index 21 points to entry with unaligned offset 0x0508001d
E/ (16856): Entry offset at index 0 points outside the Type's boundaries
E/ (16856): Entry offset at index 1 points outside the Type's boundaries
E/ (16856): Entry offset at index 2 points outside the Type's boundaries
E/ (16856): Entry offset at index 3 points outside the Type's boundaries
01-15 00:10:13 E/AaptParser: Failed to run aapt2 on D:\xts\16_r3\android-cts\testcases\CtsCameraTestCases\arm64\CtsCameraTestCases.apk. stdout:
01-15 00:10:13 E/ModuleDefinition: Unexpected Exception from preparer: com.android.tradefed.targetprep.suite.SuiteApkInstaller
01-15 00:10:13 E/ModuleDefinition: AaptParser failed for file CtsCameraTestCases.apk. The APK won't be installed
com.android.tradefed.targetprep.TargetSetupError[AAPT_PARSER_FAILED|520050|DEPENDENCY_ISSUE]: AaptParser failed for file CtsCameraTestCases.apk. The APK won't be installed
at com.android.tradefed.targetprep.TestAppInstallSetup.parsePackageName(TestAppInstallSetup.java:783)
at com.android.tradefed.targetprep.TestAppInstallSetup.resolveApkFiles(TestAppInstallSetup.java:671)
at com.android.tradefed.targetprep.TestAppInstallSetup.setUp(TestAppInstallSetup.java:443)
at com.android.tradefed.testtype.suite.ModuleDefinition.runPreparerSetup(ModuleDefinition.java:1111)
at com.android.tradefed.testtype.suite.ModuleDefinition.runTargetPreparation(ModuleDefinition.java:1597)
at com.android.tradefed.testtype.suite.ModuleDefinition.runPreparation(ModuleDefinition.java:1070)
at com.android.tradefed.testtype.suite.ModuleDefinition.run(ModuleDefinition.java:542)
at com.android.tradefed.testtype.suite.ITestSuite.runSingleModule(ITestSuite.java:1495)
at com.android.tradefed.testtype.suite.ITestSuite.run(ITestSuite.java:1117)
at com.android.tradefed.invoker.InvocationExecution.runTest(InvocationExecution.java:1538)
at com.android.tradefed.invoker.InvocationExecution.runTests(InvocationExecution.java:1313)
at com.android.tradefed.invoker.TestInvocation.prepareAndRun(TestInvocation.java:677)
at com.android.tradefed.invoker.TestInvocation.performInvocation(TestInvocation.java:303)
at com.android.tradefed.invoker.TestInvocation.invoke(TestInvocation.java:1514)
at com.android.tradefed.command.CommandScheduler$InvocationThread.run(CommandScheduler.java:723)
01-15 00:10:13 E/ModuleDefinition: Some preparation step failed. failing the module arm64-v8a CtsCameraTestCases
原因是aapt2版本较低,和编译CTS apk的版本不匹配导致,替换新版本aapt2工具后问题解决
aapt2工具下载链接:
aapt2-8.2.0-alpha10-10154469:https://download.csdn.net/download/weixin_42524582/92561474
更多推荐
所有评论(0)