【发布时间】:2010-06-07 16:11:28
【问题描述】:
情况如下。
我在 Eclipse 中有一个依赖于 commons-codec 的 java 项目“LicenseGenerator”。因此,我将 commons-codec jar 文件添加到构建路径中。我进行了 Junit 测试,一切正常。
我在同一个工作区创建了一个不同的项目——它恰好是一个 Android 项目——它需要使用我的 LicenseGenerator 类。我将 LicenseGenerator 添加到构建路径的“项目”选项卡中 - 类已被识别并且我能够使用它们。
一切都编译并运行。但是,当从我的 Android 项目中调用使用 commons-codec 的 LicenseGenerator 部分时,出现以下错误。
找不到方法 org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString, 引用自方法
这基本上告诉我commons-codec没有打包到android项目中,所以我也将commons-codec添加到android项目中但是出现了同样的错误。
我该如何解决这个问题? alt text http://droidprofessor.com/trash/commons-codec5.png
alt text http://droidprofessor.com/trash/commons-codec4.png
alt text http://droidprofessor.com/trash/commons-codec1.png
【问题讨论】: