使用Android的BouncyCastle找不到DataFlavor类

时间:2019-01-30 10:19:37

标签: android javamail bouncycastle

我已成功将 BouncyCastle 导入我的Android项目,并将用于Android软件包的 javamail 添加到我的项目here.

我现在在尝试对文件签名时遇到问题, BouncyCastle 尝试访问位于DataFlavor程序包中的名为java.awt.datatransfer的类。

我阅读了一些帖子,就我而言,该类位于myjava.awt.datatransfer

Javamail 罐中的android

所以我修改了 BouncyCastle jar的源来访问此类,但不幸的是,这没有用,现在它告诉我了

  

“无法从ActivationDataFlavor转换为DataFlavor”。

有人知道我该如何解决这个问题? 帮助将不胜感激!

修改

这是应用程序崩溃时的完整堆栈跟踪

  

java.lang.NoClassDefFoundError:无法解决以下问题:   [Ljava / AWT /数据传递/的DataFlavor;                                                                                             在org.bouncycastle.mail.smime.handlers.pkcs7_mime。(未知   资料来源:16)                                                                                             在java.lang.Class.newInstance(本地方法)                                                                                             在   javax.activation.MailcapCommandMap.getDataContentHandler(MailcapCommandMap.java:609)                                                                                             在   javax.activation.MailcapCommandMap.createDataContentHandler(MailcapCommandMap.java:563)                                                                                             在   javax.activation.DataHandler.getDataContentHandler(DataHandler.java:626)                                                                                             在javax.activation.DataHandler.writeTo(DataHandler.java:329)                                                                                             在javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1692)                                                                                             在javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:996)

0 个答案:

没有答案