在 Android Studio 中包含 iTextG 时出现以下错误,
com.android.dex.DexException: Multiple dex files define Lcom/itextpdf/awt/geom/AffineTransform;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
我不知道为什么,但似乎这个库中也有 awt。这就是我包含它的方式:
- 从http://sourceforge.net/projects/itextg/下载 itextg
- 提取jar文件
- 将itextg-5.5.4.jar复制到app目录下的libs文件夹下
- 梯度清洁
为什么awt还在图书馆?