3

I have downloaded the binary Zip from here. I extracted the zip to a folder. Then I right clicked on libs folder in Eclipse. I Imported the *.jar file to the libs folder, and then I right clicked on it and added to path. I added

 import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;

to my java file, and i am adding values to

DescriptiveStatistics rStandardDeviation = new DescriptiveStatistics();

and after that I run the math part by:

double bMean = bStandardDeviation.getMean();
double rStd = rStandardDeviation.getStandardDeviation();

No errors on compile, clean, or build. When I attempt to run the app on my phone i get:

Could not find class 'org.apache.commons.math3.stat.descriptive.DescriptiveStatistics', referenced from method com.example.mydemo.MainActivity.<init>

Any ideas anyone what is going wrong?

Thank you

KingsInnerSoul
  • 1,373
  • 4
  • 20
  • 49

1 Answers1

4

In your Build Configuration, make sure you check your library to be exported in Order and Export. See

enter image description here

Gabriele Petronella
  • 106,943
  • 21
  • 217
  • 235
  • Putting the jar in the libs folder should be sufficient. If you look in a normal Android project (which your screenshot is not of) you should see an item for Android dependencies in Order and Export which automatically takes care of it for you. – kabuko Apr 11 '13 at 19:50
  • 2
    What fixed it for me was removing all the paths that i added, and deleting all the folders/files i added. Then actually place the jar file in the Libs folder. Then in eclipse, I refreshed the package explorer, and `added to path` the jar file from there. Not sure what I did wrong before hand, but that jsut fixed it all. – KingsInnerSoul Apr 13 '13 at 03:59