使用命令下载的axios包,默认最新版的,如果你的API是9,那么就会报错

ERROR: The compatibleSdkVersion 9 cannot be smaller than version 12 declared in library [:library]            as the library might be using APIS not available in 9

如图

ERROR: Failed :entry:default@MergeProfile... 
> hvigor ERROR: The compatibleSdkVersion 9 cannot be smaller than version 12 declared in library [:library] 
          as the library might be using APIS not available in 9
> hvigor ERROR: BUILD FAILED in 256 ms

解决办法:

        找到目录:

        删除^,并且手动改为2.2.0即可,鼠标放上去就会提示,自动重新下包就能解决。

Logo

讨论HarmonyOS开发技术,专注于API与组件、DevEco Studio、测试、元服务和应用上架分发等。

更多推荐