We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Andre_LB
8 years agoExplorer | Level 3
v2 API
Hi Dropbox Team, I am trying, using Dropbox API, to access my files in Dropbox. I have already done it with Dropbox API v1 and now I would like to do it with v2. For this reason, I performed as fo...
chirstius
Dropbox Staff
8 years ago
Can you please include details for the warnings and anything else logged about the error? Also, simple question, have you done a clean build? (Build | Clean Project)
Thanks,
-Chuck
Andre_LB
8 years agoExplorer | Level 3
Hi Chuck,
thanks again for your reply and effort.
There are 57 warnings as, please, you can see: I am posting the first ten and the last seven.
Let me know, please, if you need the complete warning list.
Yes, I have. But clean build is the only command performed by me (apart from Sync Project and Run App).
Do you think me to have to execute something else?
Thanks, again.
Kind Regards,
Andre
=================================
Information:Gradle tasks [:app:assembleDebug]
Warning:com.dropbox.core.DbxStandardSessionStore: can't find referenced class javax.servlet.http.HttpSession
Warning:com.dropbox.core.http.GoogleAppEngineRequestor: can't find referenced class com.google.appengine.api.urlfetch.URLFetchServiceFactory
Warning:com.dropbox.core.http.GoogleAppEngineRequestor: can't find referenced class com.google.appengine.api.urlfetch.HTTPMethod
Warning:com.dropbox.core.http.GoogleAppEngineRequestor: can't find referenced class com.google.appengine.api.urlfetch.URLFetchService
Warning:com.dropbox.core.http.GoogleAppEngineRequestor: can't find referenced class com.google.appengine.api.urlfetch.HTTPMethod
Warning:com.dropbox.core.http.GoogleAppEngineRequestor: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
Warning:com.dropbox.core.http.GoogleAppEngineRequestor: can't find referenced class com.google.appengine.api.urlfetch.HTTPHeader
Warning:com.dropbox.core.http.GoogleAppEngineRequestor: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
Warning:com.dropbox.core.http.GoogleAppEngineRequestor: can't find referenced class com.google.appengine.api.urlfetch.FetchOptions$Builder
Warning:com.dropbox.core.http.GoogleAppEngineRequestor: can't find referenced class com.google.appengine.api.urlfetch.FetchOptions
Warning:com.dropbox.core.http.GoogleAppEngineRequestor: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
......................................................................................................................
Warning:com.dropbox.core.http.GoogleAppEngineRequestor$FetchServiceUploader: can't find referenced class com.google.appengine.api.urlfetch.URLFetchService
Warning:com.dropbox.core.http.GoogleAppEngineRequestor$FetchServiceUploader: can't find referenced class com.google.appengine.api.urlfetch.HTTPRequest
Warning:com.dropbox.core.http.GoogleAppEngineRequestor$FetchServiceUploader: can't find referenced class com.google.appengine.api.urlfetch.HTTPResponse
Warning:okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning:okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning:there were 77 unresolved references to classes or interfaces.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForDebug'.
> Job failed, see logs for details
Information:BUILD FAILED in 15s
Information:1 error
Information:57 warnings
Information:See complete output in console
- Andre_LB8 years agoExplorer | Level 3
Hi Chuck,
I have a doubt.
Till now, I have always sent you the "Module: app" build.gradle file.
Attached, please, you may fing the "Project: PrvDef" one.
Is this correct? Thanks, in advance.
Kind Regards,
Andre
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
} - chirstius8 years ago
Dropbox Staff
Let's take a step back here. At this point, I think it's best to just get the Android example app from the Java SDK repository running. I want to make sure we're both on the same page there. PrvDef is your custom application, correct? For the moment, I think we should hold off on that.
Can you please verify that we're currently working with a cleanly checked out copy of the Android example app that has been imported into Android studio?
If not, let's start over with that and try to get it up and running.
Thanks,
-Chuck
- Andre_LB8 years agoExplorer | Level 3
Hi Chuck,
I downloaded the DropBox-SDK, executed "Import Project" in Android Studio and selected the folder:
..\examples\androidSince I have got the following error:-
Error:Failed to resolve: com.dropbox.core:dropbox-core-sdk:0-SNAPSHOT
I changed in the build.gradle file (Module: Android):-
compile group: 'com.dropbox.core', name: 'dropbox-core-sdk', version: '0-SNAPSHOT', changing: true
into:-
compile 'com.dropbox.core:dropbox-core-sdk:3.0.6'
Then, in my developer app console, I created the app "UserActivity" and updated the app key in AndroidManifest file and res/strings file.
Very well: now I am able to Authenticate and download a file.
Tomorrow I am going to check the differences between your example and my app (I confirm PrvDef is my custom application).
Thank you very much for your kind help and effort.
Kind Regards,
Andre
- chirstius8 years ago
Dropbox Staff
Thanks for the update and I'm glad the steps presented here before have allowed you to get the example app working. I think you're taking the right next steps by comparing between the two (example, and your app) and finding what differences might be causing the issue.
We'll still be here if you need help with anything Dropbox specific, but it sounds like you're on a good path to getting things resolved.
Thanks!
-Chuck
- Andre_LB8 years agoExplorer | Level 3
Hi Chuck,
thank you very much for your support: now my app is able to download and upload a file in my DropBox repository.
For being honest, I am not sure why before it did not work.
I tried to understand, but I would not be able, at the moment, to say why.
It is not important for me, but if it is for you, please, let me know and I could try to investigate.
At the moment, I am working in understanding how obtain FileMetadata information of a file.
Indeed I obtained the file revision of the downloaded one, by your example.
In other words, if I had not had from your example this information I would not be able to obtain it.
I tried to see in DropBox documentation, but I was not able to see anything.
mDbxClient.files().download(metadata.getPathLower(), metadata.getRev())
.download(outputStream);That is, the .files().download() method needs the file path and revision. In the code it is obtained by metadata.
So, the kind question is: let us suppose to know the DropBox folder and file name.
How may I obtain its own FileMetadata metadata information?
Thank you very much, again.
Kind Regards,
Andrea
- Greg-DB8 years ago
Dropbox Community Moderator
If you know the path to the file, you can get the file metadata using `files().getMetadata()`:
https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#getMetadata-java.lang.String-
By the way, if you just want to download the latest version of the file, you don't need to supply the 'rev' too. There's a version of the `files().download()` method that requires just the 'path' and not the 'rev': - Andre_LB8 years agoExplorer | Level 3
Hi Greg,
yes, I have just tied and it works.
@ Greg, Chuck: thank you very much for your help.
Now I may do, with API v2, what I need.
Kind Regards,
Andrea
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!