Getting started with DropboxAPI, class not found - java

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;

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.

Please check the name of the project libs, its correct name is libs.

Related

Eclipse points to the wrong path in dependencies

I have an Android Application project in Eclipse, and for nth time I have this annoying error. I create a new blank project which references android-support-v7-appcompat library. The JAR files of this library are located at
android-support-v7-appcompat\libs.
However Eclipse insists, that they are in
android-support-v7-appcompat\bin, and the result is as follows:
http://i.stack.imgur.com/Ho7qN.png
What the hell is going on here? The support library is installed, there is nothing else that this project is referencing, all should be fine. Any ideas?
You must be having appcompat project in project explorer. expand bin folder of that project and check whether it has appcompat_v7.jar in it. If not then clean and build the project.
What seems to be the solution is :
Either update the config file where the preferred path is as android-support-v7-appcompat\bin ,
or else do not paste lib files in android-support-v7-appcompat\libs , instead put them in bin directory .
still , let me check why else this issue can come , will post in this thread.

Android libs error

I am using Parse.com and I upgraded the parse SDK from 1.2.4 to 1.3.0. I have deleted the 1.2.4 files from the libs folder and pasted the 1.3.0 files to libs folder. When I am trying to run my app now it is crashing with no error. After debugging I found out that when I try to open any declaration of Parse class files it shows me this:
Here is the build path screenshot:
I have tried to clean the project, closed and opened eclipse.
I am stucked! Any help would be appreciated
Please verify the BuildPath as well.
Right Click on the Project -> BuildPath -> Configure Build Path
Check to see there is .jar files or not. If there are no .jar files, Upload using "Add Jars" button from your libs directory. Once Build Path is configured, clean and run the Project. Hope this will help you.
From your figure you posted, it just that your editor cannot find source for your jar file. But in your figure i do see javadoc. In the same page you will see a button called "Attach source". You can click that button to locate manually your javadoc. With this you should be able to go to source code.
I found the solution, but it was not related to the libs file or to the build path. The problem was in the manifast, had to remove android:noHistory="true" from my activity tag and the every thing worked fine.

Android java.lang.NoClassDefFoundError after import JAR

I got a problem...
I made a Jar (called "GeoFence.jar"), that I have to use on a Android Project.
So, what I done is:
Look In so many webs HowTo's
create "libs" folder in the android project.
add my JAR (manually)
then I went to Java Build Path and checked that my JAR was included to the Android Dependences.
finally I made the necessary Imports to use the class I need from JAR.
After do all of this, I runned my App, and it throws this error:
and I don't understand what's going on, cause, I Fixed the Project Properties and cleaned it. And it's still not working.
Here is how i have the structure and the build path.
for adding jar use below two stpe: but for you just do 2nd.
1. Your Project -> right click -> Properties -> Java Build Path -> Libraries -> Add Jar -> yourjar.jar
2. Your Project -> right click -> Properties -> Java Build Path -> Order & Export --> Select All --> OK
After taht just clean your Project and RUN.
If you go to you Android Dependencies folder, you should be able to expand the GeoFence.jar file. This way, you should be able to find the class com.elias.polygon.City if you keep expanding subfolders.
If you CANNOT see it, you probably made an error in exporting the jar file.
To solve the export see this question on so
If you CAN see the class, you have an error in your build path/ project properties
To solve the project setup, see this question
the problem that I had, was that the jar I wanted to import, used some packages that in android are not "allowed" so I had to do in a different way.
After that, it happens the same, but the problem was that the Jar was Build in v1.7.
When I builded in v1.6 android accepted it.
So, first of all look for:
Don't use packacges that in android are not allowed
Look in which version is builded the solution.

IllegalArgumentException error after added google jar

I get this error
java.lang.IllegalArgumentException: already added: Lcom/google/protobuf/AbstractMessageLite$Builder$LimitedInputStream;
and at the bottom of the Log,
Conversion to Dalvik format failed with error 1
after I added the 'libs' folder that includes jar files for google map/place that I'm trying to implement to an existing package.
I've done some research and found a solution which that
Project » Properties » Java Build Path » Libraries and remove all except the "Android X.Y"
but that's not in my case since I can't remove them from the list.(I can remove the Android Dependencies folder but i'm not sure if i should do that)
This issue is that you've got two jar files with duplicate classes. Try removing protobuf, if everything still compiles happily then hey presto you're in luck.
Otherwise, one workaround I found here is:
Add the library project using project properties -> android - add library project.
Add the linked src files to your build path as well.
Build the project. You should see the class files from you library project in the bin folder.
After that, REMOVE the linked src files from the library project in your application >project.
Run your application.
If you clean the project, then repeat these steps from step 2.

Java Eclipse - How do I change the classpath?

I copied an Eclipse project from my PC (eclipse is on drive D) to the laptop (eclipse is on drive c) but when I try to deploy the agents I have in my project I keep getting the following error:
The archive **D**:/eclipse/plugins/it.fbk.sra.ejade_0.9.0/lib/libjade4/commons-codec-1.3.jar which is referenced by the classpath does not exist.
I changed all the libraries' addresses to the correct ones (C:/eclipse/plugins/it.fbk.sra.ejade_0.9.0/lib/libjade4/__etc__) for all of them by right clicking the project > build path > configure build path... but that doesn't work. I also tried to refresh the project, restart eclipse but still nothing..
Any suggestions?
Thanks a lot!
First make sure that the .jar file is exist in the given path,if so then you can easily try making a new project and copy your material to it, and configure it to the .jar path.
If this doesn't work you may need to remove the temporary files from your project and eclipse on your laptop.
Also, please give more description about what happens on right clicking the project > build path > configure build path ?
Hope everything works well.
I had the same problem and just discovered the solution to this.
Go to project>properties>Java Build Path>Libraries>Add External JARS.
After specifying JAR file at a certain location, you will see it in previous window "JARs and class folders on the build path:" with "JAR_fileName - C:\YOURPATH".
Don't stop here instead click on the "+" button to the left to expand it, and IF it says "Source attachment: (NONE)", you double click it and add the path to the JAR file by selecting Workspace location.
This solved the problem for me.
Had the same problem and non of the above solutions worked.
This is how I fixed it.
go to your project folder
open .classpath file (enable view hidden files if its not showing)
edit the path
delete the project from workspace. Imp: Don't select (Delete project
content) checkbox when prompted. !!!
re-import the same project
I had the same issue...
I was refering jars from a mapped drive, when I moved them to my local drives, it started working fine. Also try giving a shorte path for the jars.

Categories

Resources