Android引入第三方包出现conversion to dalvik format failed with error 1 解决

 

在Android项目中引入第三方包出现错误:conversion to dalvik format failed with error 1。

在引入包的时候,如果你直接Add external jar....的话,会发现部分包加入没有问题,部分包加入有问题。

在android项目中引入第三方包最好不要这么做。

解决方法:

官方文档说明:

You can use a third party JAR in your application by adding it to your Eclipse project as follows:

  1. In the Package Explorer panel, right-click on your project and select Properties.
  2. Select Java Build Path, then the tab Libraries.
  3. Press the Add External JARs... button and select the JAR file.

Alternatively, if you want to include third party JARs with your package, create a new directory for them within your project and select Add Library... instead.

It is not necessary to put external JARs in the assets folder.

 

翻译后意思:

1.右键项目,选择properties;

2.选择Java Build Path,切换到Libraries;

3.点击Add Library...,选择User Library后Next;

4. 在出现的界面中点击“New..”

5. 在弹出的界面中随便取一个名字,点击“确定”
6. 点击“Add jars”按钮选择你要引入的第三方包,点击“确定”即可。

 

这两种引包的方法如果是我们常使用的java或者web项目,一点问题都没有的。不知道为什么android项目存在这么垃圾问题。还是按照规范来做吧。管它为什么的

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值