I'm trying to use the Dropbox API for the first time, but i'm getting this error when launching my app.
Caused by: java.lang.NoClassDefFoundError: com.dropbox.client2.session.Session$AccessType
I saw on Dropbox forums a guy with the same problem, and the solution was to rename the class path to libs/ instead of lib/. I did it and didn't work.
I get the error here:
final static private AccessType ACCESS_TYPE = AccessType.APP_FOLDER;
any ideas?
This problem appeared when I imported dropbox jars in the next way: eclipse project menu -> Build Path -> Configure Build Path -> Libraries -> Add External JARs;
After that, I revert changes, create folder 'libs' in Project Explorer, in 'libs' folder menu select 'Import...' -> File System. Select path and import all jars into 'libs' project folder. Problem disappear.
My mistake, the problem was the classPath.
I had to add all reference libraries in both the lib and libs folder before it worked, so something is clearly wrong, and for some reason it needs apache-mime4j-0.6 in the lib folder, but the example project from Dropbox on how to implement it don't? can someone from the Dropbox Team deliberate on this? Note: the application used the previous deprecated api, and when I tried updating it with the newest I got this error.
java.lang.NoClassDefFoundError: com.dropbox.client2.session.Session$AccessType
on
private AccessType ACCESS_TYPE = AccessType.APP_FOLDER;
Step to set jar file for dropbox .
u must add dropbox-android-Sdk.jar file as library.
Add to build path and then go to properties.
go in java build path and click order and export and click that dropbox-android-sdk.jar file.
u can also add jar and locate your dropbox-android-sdk.jar file and then ok.
Working in Eclipse (Luna) I could resolve the error by Project->Properties->Java Build Path->Order And Export and then putting a tick on (in my case for Dropbox 1.6.3) the two Dropbox jar files.
Followed by the usual clean project and run.
This is reproducable by removing the checks marks from the boxes in the Order and Export dialog.
来源:https://stackoverflow.com/questions/10557633/getting-started-with-dropboxapi-class-not-found