【问题标题】:Could not find class error when trying to upload a video to YouTube using the gdata API尝试使用 gdata API 将视频上传到 YouTube 时找不到类错误
【发布时间】:2011-09-26 16:15:30
【问题描述】:

我目前正在编写 Android 应用程序的一部分,以使用 Google 数据 API 将视频上传到 YouTube。我有来自 Google Code 的最新版本的 API,我暂时基本上从他们的Developer's Guide 复制了示例。

一切都编译没有警告或错误,应用程序运行良好。但是当我调用 service.insert(...) 我得到以下堆栈跟踪:

ERROR/dalvikvm(19489): Could not find class 'com.google.gdata.data.media.MediaBodyPart$MediaSourceDataHandler', referenced from method com.google.gdata.data.media.MediaBodyPart.initMediaDataHandler
ERROR/dalvikvm(19489): Could not find class 'javax.activation.DataHandler', referenced from method com.google.gdata.data.media.MediaBodyPart.initMediaDataHandler
ERROR/dalvikvm(19489): Could not find class 'javax.mail.internet.MimeBodyPart$MimePartDataHandler', referenced from method javax.mail.internet.MimeBodyPart.writeTo
ERROR/dalvikvm(19489): Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeBodyPart.attachFile
ERROR/dalvikvm(19489): Could not find class 'javax.mail.internet.MimeBodyPart$MimePartDataHandler', referenced from method javax.mail.internet.MimeBodyPart.getDataHandler
ERROR/dalvikvm(19489): Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeBodyPart.setContent
ERROR/dalvikvm(19489): Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeBodyPart.setContent
ERROR/dalvikvm(19489): Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeBodyPart.updateHeaders

出现 NoClassDefFoundError。

我在 Eclipse 中拥有链接到我的项目的 gdata API 的所有依赖项(这两个包含在 API 的 deps 目录中,还有 javamail、activation 和 servlet-api),并且我尝试添加所有 jar 文件到 Eclipse 中的类路径。我查看了相关的 jars,它声称找不到的所有类都在那里。

如果有人能以任何方式提供帮助 - 现阶段的任何想法都将不胜感激。

谢谢

【问题讨论】:

  • 你用gdata上传视频了吗?
  • @gtumca-MAC 是的,在 Android 上。我使用了我在原始问题中发布的指南来帮助我入门。

标签: android youtube-api gdata-api


【解决方案1】:

事实证明,普通的 JavaMail/Activation 包目前无法在 Android 上运行。解决方案是使用JavaMail for Android,效果很好。

【讨论】:

    猜你喜欢
    • 2012-06-07
    • 1970-01-01
    • 2017-08-07
    • 1970-01-01
    • 2012-03-31
    • 2011-09-11
    • 1970-01-01
    • 2012-05-06
    • 1970-01-01
    相关资源
    最近更新 更多