Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
gmartins
9 years agoExplorer | Level 3
Android API v2 - Can't build the sdk
Hi there, I'm currently trying to upgrade the sdk to v2, however, I'm struggling with simply building the repository in order to check the examples. I'm running ./gradlew install in the root ...
Greg-DB
Dropbox Community Moderator
9 years agoDid you successfully run the steps under "Building from source" first?
https://github.com/dropbox/dropbox-sdk-java#building-from-source
If so, can you run with --stacktrace to get more error output?
Also, for reference, you don't need to build the SDK from source if you don't want to. You can install the package from Maven or Gradle using a versioned dependency if you want:
https://github.com/dropbox/dropbox-sdk-java#setup
https://github.com/dropbox/dropbox-sdk-java#building-from-source
If so, can you run with --stacktrace to get more error output?
Also, for reference, you don't need to build the SDK from source if you don't want to. You can install the package from Maven or Gradle using a versioned dependency if you want:
https://github.com/dropbox/dropbox-sdk-java#setup
gmartins
9 years agoExplorer | Level 3
No, ./gradlew build won't compile.
Here's the stacktraced log:
> Configure project : Set JDK6_HOME environment to disable boot classpath warnings. > Task :generateStone Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/Users/glaubermartins/AndroidStudioProjects/dropbox-sdk-java/stone/stone/cli.py", line 16, in <module> from .cli_helpers import parse_route_attr_filter File "/Users/glaubermartins/AndroidStudioProjects/dropbox-sdk-java/stone/stone/cli_helpers.py", line 4, in <module> from ply import lex, yacc ImportError: No module named ply FAILURE: Build failed with an exception. * Where: Script '/Users/glaubermartins/AndroidStudioProjects/dropbox-sdk-java/stone.gradle' line: 72 * What went wrong: Execution failed for task ':generateStone'. > Process 'command 'python'' finished with non-zero exit value 1 * Try: Run with --info or --debug option to get more log output. * Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':generateStone'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:242) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:235) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:224) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:121) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:77) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:102) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:96) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:612) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:567) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:96) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) Caused by: org.gradle.process.internal.ExecException: Process 'command 'python'' finished with non-zero exit value 1 at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:370) at org.gradle.process.internal.DefaultExecAction.execute(DefaultExecAction.java:31) at org.gradle.api.internal.file.DefaultFileOperations.exec(DefaultFileOperations.java:182) at org.gradle.api.internal.project.DefaultProject.exec(DefaultProject.java:1071) at org.gradle.api.internal.project.DefaultProject.exec(DefaultProject.java:1066) at org.gradle.api.Project$exec$2.call(Unknown Source) at stone_mz9vxdtllntegk11x6bi4n71.runStoneGenerator(/Users/glaubermartins/AndroidStudioProjects/dropbox-sdk-java/stone.gradle:72) at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:479) at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:191) at org.gradle.groovy.scripts.BasicScript$ScriptDynamicObject.tryInvokeMethod(BasicScript.java:130) at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:80) at org.gradle.internal.metaobject.BeanDynamicObject$GroovyObjectAdapter.invokeOpaqueMethod(BeanDynamicObject.java:579) at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:506) at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:191) at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:80) at stone_mz9vxdtllntegk11x6bi4n71$_run_closure1$_closure8$_closure14.doCall(/Users/glaubermartins/AndroidStudioProjects/dropbox-sdk-java/stone.gradle:135) at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:670) at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:651) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92) ... 27 more
Besides that, I'm also having a hard time with Auth.getOAuth2Token(). After signing in the browser and back to the app it won't give me the token, however, if I have the dropbox app installed I get the token back. Anything I might be missing?
Thank you.
- overjeer9 years agoHelpful | Level 6
Hey mate - it looks like you are trying to build the Dropbox SDK from source and it also looks like you are missing a python module and its getting quite messy. From your logs it looks like I would be correct in assuming you are trying to use the Dropbox SDK within an Android project.
There is an easier way and it worked for me.
For me (in my android app of course), in the app level build.gradle, all I needed to do is add this under dependencies { } and it worked OK. I am not sure if this will help you at all.
dependencies {
//other content removed for more clarity. Here you will have your app level gradle dependencies.
compile 'com.dropbox.core:dropbox-core-sdk:3.0.4'
}- galessandro9 years agoNew member | Level 2
overjeer ha escrito:Hey mate - it looks like you are trying to build the Dropbox SDK from source and it also looks like you are missing a python module and its getting quite messy. From your logs it looks like I would be correct in assuming you are trying to use the Dropbox SDK within an Android project.
There is an easier way and it worked for me.
For me (in my android app of course), in the app level build.gradle, all I needed to do is add this under dependencies { } and it worked OK. I am not sure if this will help you at all.
dependencies {
//other content removed for more clarity. Here you will have your app level gradle dependencies.
compile 'com.dropbox.core:dropbox-core-sdk:3.0.4'
}Thanks, it worked for me!!
- Greg-DB9 years ago
Dropbox Community Moderator
gmartins It looks like you're missing Stone's dependencies. You can install them like this:
sudo -H python -m pip install ply six typing
Anyway, as overjeer and I mentioned, it's easier to just use a package manager than to build from source.
Also, it looks like you resolved the token issue here: https://github.com/dropbox/dropbox-sdk-java/issues/161
- Qbert9 years agoExplorer | Level 3
Hi guys,
I have the same issue.
The python installer won´t work for me either. I am trying the commands on the git bash, closest I could see to a Linux shell. But to no avail.
I do neither have a gradle nor maven build and hence I do not know what libs (jars) to add to the Java (Android?) build.
Is it lib/jackson-core-2.7.4.jar and dropbox-core-sdk-3.0.5.jar?
The json_simple-1.1.jar is not needed any longer?
- Greg-DB9 years ago
Dropbox Community Moderator
Qbert If you want to use the jars directly, you can find them in the tar/zip downloads for each release:
https://github.com/dropbox/dropbox-sdk-java/releases
That includes the required dependencies, i.e., just the 'dropbox' and 'jackson' jars, which is all you need typically. (It doesn't include optional dependencies for non-default functionality, such as okhttp.)
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!