Using CubeIDE libs

Using Mbed-cli or Mbed Studio?

There is this thread that suggests that you rename the extension to .ar, worht a try.

Another option, but requires some setup is to move to mbed-cmake toolchain.