简体   繁体   English

在Android中使用外部Java库

[英]Use External Java Library in Android

I have to use one of mashape api in my android application, for that I have to include their java support library named unirest to my android project, I have added that library via build configuration settings. 我必须在我的android应用程序中使用mashape api之一,因为我必须将其名为unirest的java支持库包括到我的android项目中,我已通过构建配置设置添加了该库。 but when I run the project it throws java.lang.ExceptionInInitializerError and stops application.is there any way to resolve this problem ? 但是当我运行该项目时,它会抛出java.lang.ExceptionInInitializerError并停止application。是否有任何方法可以解决此问题?

when using third-party libs on android you should follow these steps: 在Android上使用第三方库时,您应遵循以下步骤:

  1. right click on your project 右键点击您的项目
  2. select properties from the menu 从菜单中选择属性
  3. in the new window select Java build path 在新窗口中选择Java构建路径
  4. in Order and export tab make sure that the libraries are checked 在“ 订单和导出”选项卡中,确保已选中库
  5. click ok and run 单击确定并运行

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM