如何将外部库添加到 android 虚拟设备?

How to add external libraries to android virtual device?

我有一个使用外部库的 android 应用程序。我想在 Android 虚拟设备上 运行 该应用程序。 android 文档说:

If your application declares a uses-library element in its manifest file, the application can only run on a system image in which that external library is present. If you want to run your application on an emulator, create an AVD that includes the required library. Usually, you must create such an AVD using an Add-on component for the AVD's platform (for example, the Google APIs Add-on contains the Google Maps library).

如何创建包含库文件的 AVD。

<uses-library> 用于根据用户设备上图书馆的可用性限制 Google Play 中的应用可用性,例如 Google 地图。它不用于声明您在项目中编译的第三方库。这是在 build.gradle 文件中完成的。

更多信息在这里:https://developer.android.com/tools/building/configuring-gradle.html#declareDeps