views:

54

answers:

2

Here is the situation.

I have a java project "LicenseGenerator" in eclipse that depends on commons-codec. I have therefore added the commons-codec jar file to the build path. I have Junit tests and everything is working fine.

I have made a different project in the same workspace - which happens to be an Android project - that needs to use my LicenseGenerator classes. I added LicenseGenerator to the "projects" tab in the build path - the classes were recognized and I was able to use them.

Everything compiled and ran. However, when the part of the LicenseGenerator that used the commons-codec was called from my Android project I got the following error.

Could not find method org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString, referenced from method

This basically tells me that the commons-codec was not packaged which the Android project, so I added the commons-codec to the android project as well but the same error appears.

how do I fix this? alt text

alt text

alt text

alt text

alt text

+1  A: 

Go to the Order and Export tab of the Build Path dialog, and check the libraries that you want to export as dependencies of other projects.

Exported entries are contributed to dependent projects

Bozho
I did that and it still does not work. I ticked the box next to commons-codec in the java build path for LicenseGenerator. I also tried moving it to the top.
jax
clean and rebuild.
Bozho
Still not working. I selected Project-->Clean, then ticked both projects.
jax
Bozho
OK, done - see above
jax
A: 

It appears that this is a problem with the Android API

http://stackoverflow.com/questions/2047706/apache-commons-codec-with-android-could-not-find-method

jax