cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OkHttp3Requestor.INSTANCE compile error after updating Java SDK to 3.0.3

OkHttp3Requestor.INSTANCE compile error after updating Java SDK to 3.0.3

Robert S.138
Helpful | Level 7

This Android code was working fine with dropbox-core-sdk-2.1.1 but when I updated to dropbox-core-3.0.3, this code produced a compile error:

 

DbxRequestConfig.Builder a = DbxRequestConfig.newBuilder("MyAppName");
DbxRequestConfig.Builder b = a.withHttpRequestor(OkHttp3Requestor.INSTANCE);
DbxRequestConfig requestConfig = b.build();

 The error is:

 

Error:(97, 70) error: cannot find symbol variable INSTANCE

 

Why?

4 Replies 4

Robert S.138
Helpful | Level 7

OK, I got this to work, but I don't really understand what is going on, so if anyone can verify that this is right, I would appreciate it.  I replaced:

 

DbxRequestConfig.Builder a = DbxRequestConfig.newBuilder("TuneLabPianoTuner/2.3");
DbxRequestConfig.Builder b = a.withHttpRequestor(OkHttp3Requestor.INSTANCE);
DbxRequestConfig requestConfig = b.build();
sDbxClient = new DbxClientV2(requestConfig, Main.DBaccessToken);

with this code:

DbxRequestConfig.Builder b = DbxRequestConfig.newBuilder("TuneLabPianoTuner/2.3");
DbxRequestConfig requestConfig = b.build();
sDbxClient = new DbxClientV2(requestConfig, Main.DBaccessToken);

and avoided the whole issue with OkHttp2Requestor.INSTANCE.  I briefly tested my application, and it did indeed access my dropbox files.  So what, if anything, am I missing by not augementing my DbxRequestionConfig.Builder ?

Greg-DB
Dropbox Staff

The OkHttp3Requestor.INSTANCE was removed in v3.0.0.

 

You can still use OkHttp3Requestor as shown in this example.

 

Your solution of removing the use of OkHttp3Requestor entirely is also fine. In that case, the SDK would use StandardHttpRequestor instead. Which to use if up to you. 

Robert S.138
Helpful | Level 7

The Dropbox support website still links to the 2.1.2 SDK documenation, which of course still refers to OkHttp3Requestor.INSTANCE.  If you are on to version 3.x.x now, shouldn't your website link to the 3.x.x documentation?  (Start at www.dropbox.com/developers and click on Java, then the Documenation tab, and then "full documenation".)

 

Greg-DB
Dropbox Staff
Thanks for pointing that out! I'll ask the team to get that updated.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Robert S.138 Helpful | Level 7
What do Dropbox user levels mean?