1

I have attempted to implement the Alchemy NLP API into my android project, however I have hit a bit of a brick wall. When downloading the SDK from http://www.alchemyapi.com/developers/sdks/ you end up with a nice sample project. Imported this into eclipse, everything worked lovely. I then tried to add the classes from the test project to my own by going into my projects properties (in eclipse I may add) -> Java Build Path -> Projects tab and added the test app to my projects build path.

I then went to the Order and Export tab and ensured the newly added project was checked, gave everything a clean, and was hit by:

12-01 15:12:03.171: E/AndroidRuntime(10085): java.lang.NoClassDefFoundError: com.alchemyapi.api.AlchemyAPI

As far as I can figure out from looking into this error, the project appears to have access to the classes at compile, but not at runtime. I feel I probably have made an embarrassingly simple mistake however all the fix's I have found already on SO have not solved the issue.

Thanks in advance for any response.

Aphire
  • 1,621
  • 25
  • 55
  • Copy the class file in you project rather then just using the demo project in a build path – SweetWisher ツ Dec 18 '14 at 09:03
  • Go to the Test App project properties, then Order and Export tab and add all the references libraries to the export list. This will make Eclipse copy the references/jars to your new project as well. – xpa1492 Dec 18 '14 at 09:14

1 Answers1

0

Generally speaking: by adding Project1 as a dependency for Project2 will not automatically add Project1 dependencies to Project2. You need to explicitly add all dependencies to Project2.

In your particular case you need to:

  1. Find out which jars referenced by "nice sample project"
  2. Add those jars to built path of your app

And it should work

Sergey Karpushin
  • 874
  • 1
  • 10
  • 33