Android错误"转换为Dalvik格式失败,错误2"?

Raj*_*ddy 6 android runtime-error

我在我的应用程序中使用flurry sdk,在添加这个flurry jar文件之前它没有任何错误.在libs文件夹中添加flurry jar文件后,当我在Eclipse中编译应用程序时,我收到此错误.

trouble writing output: Too many methods: 70205; max is 65536. By package:
  5 android.accessibilityservice
  1 android.animation
  2 android.annotation
315 android.app
136 android.content
 28 android.content.pm
 47 android.content.res
 35 android.database
 14 android.database.sqlite
  8 android.gesture
113 android.graphics
 44 android.graphics.drawable
  1 android.graphics.drawable.shapes
 11 android.location
 27 android.media
 40 android.net
  1 android.net.http
  1 android.net.wifi
 96 android.os

[2013-03-04 16:42:13 - myapp] Conversion to Dalvik format failed with error 2
Run Code Online (Sandbox Code Playgroud)

我知道如何解决,error 1但这是我无法解决的新错误.我搜索了很多没有得到任何解决方案.

当我删除这个jar文件它工作正常.如果它在libs中无法运行应用程序.为什么我收到此错误.?什么是溶剂...

Com*_*are 12

由于错误是trouble writing output: Too many methods: 70205; max is 65536"对此的溶解"是将方法计数减少约10%.

通常这是因为有太多JAR并且有太多方法的错误,尽管你自己可以想象自己编写了数以万计的方法.

尝试找到一些你不需要的JAR并将其删除.例如,您可以使用ProGuard报告应用程序中的死代码 - 也许库中通常需要某个库的依赖JAR,但不需要您使用该库的方式.

ProGuard本身也可以用来从你的应用程序中删除那些死代码,而不需要所有正常的混淆.但是,这不是正常构建过程的一部分,因此您必须以某种方式为此编写Ant脚本.

  • 嗨CommonsWare我尝试在android中读取xlsx文件,我上面说错误可以给我一个proguard或自定义蚂蚁脚本的例子,以便我可以解决它? (2认同)