如何解决编译时报错owns a higher api version问题
====================================

#### 问题现象

项目编译时报错如下，请问该如何解决？

\> hvigor ERROR: ArkTS:ERROR Failed to execute es2abc.
Error Message: Error: The input abc file '/Users/xxx/Desktop/Git/KnowChat\_Harmony/oh\_modules/.ohpm/wrapper@xnnuf1xhgb6dfmf+4nqatekk3somopridtvlx+rvty0=/oh\_modules/wrapper/ets/modules.abc' owns a higher api version or a higher sdkReleaseType compared to current compilation process. \[/Users/xxx/Desktop/Git/KnowChat\_Harmony/oh\_modules/.ohpm/wrapper@xnnuf1xhgb6dfmf+4nqatekk3somopridtvlx+rvty0=/oh\_modules/wrapper/ets/modules.abc\]
Error: The input abc file '/Users/xxx/Desktop/Git/KnowChat\_Harmony/oh\_modules/.ohpm/@nertc+nertc\_sdk@x07imzcfiusn4dyjfe46yg2t+btahwg70+p5ft9p+7y=/oh\_modules/@nertc/nertc\_sdk/ets/modules.abc' owns a higher api version or a higher sdkReleaseType compared to current compilation process. \[/Users/xxx/Desktop/Git/KnowChat\_Harmony/oh\_modules/.ohpm/@nertc+nertc\_sdk@x07imzcfiusn4dyjfe46yg2t+btahwg70+p5ft9p+7y=/oh\_modules/@nertc/nertc\_sdk/ets/modules.abc\]
Error: The input abc file '/Users/xxx/Desktop/Git/KnowChat\_Harmony/oh\_modules/.ohpm/wrapper@xnnuf1xhgb6dfmf+4nqatekk3somopridtvlx+rvty0=/oh\_modules/wrapper/ets/modules.abc' owns a higher api version or a higher sdkReleaseType compared to current compilation process.
The size of programs is expected to be 434, but is 432

#### 背景知识

compatibleSdkVersionStage：用于控制不同beta版本的兼容，默认值为beta1。

#### 解决方案

当字节码har打包的兼容版本高于工程的兼容版本时会出现以上问题。查看工程和har包的build-profile.json5文件中的‘compatibleSdkVersionStage’字段，选择以下任意一种解决方案：

*   将工程中的‘compatibleSdkVersionStage’字段调整至大于或者等于har包中的版本。
*   删除字节har和工程中的‘compatibleSdkVersionStage’字段。