我正在尝试将一个库(例如 uses-library)放到 AVD 上,如果我用 ADB 推送它,操作系统不知道它存在,并且重新启动模拟器会从内存中清除推送的文件。我发现可以在启动模拟器时加载一个库:
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).
http://developer.android.com/guide/developing/devices/index.html
如何从文件而不是附加组件中包含我的库?
最佳答案
如果库在 APK 中,那么您需要将其复制到设备,然后使用模拟器上的包管理器安装它。
如果库在 Jar 中,则需要将其添加到项目构建路径中。执行此操作后,该库将包含在已编译的 APK 中,并在您安装 APK 时将其放置在模拟器上。
关于Android:在 Eclipse 中将用户库放到 AVD 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6022674/