You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

robertmiles3's avatar
robertmiles3
Helpful | Level 5
8 years ago

System.MissingFieldException using Dropbox.Api 4.3.1 on Xamarin.iOS

 

I'm attempting a test file upload using...

 

using (var client = new DropboxClient("MY_GENERATED_ACCESS_TOKEN"))
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes("some text")))
{
    var updated = await client.Files.UploadAsync(
        path: $"/Backup-{DateTime.Now.ToString("yyyy-MM-dd-HH.mm.ss.fff")}.json",
        mode: WriteMode.Overwrite.Instance,
        autorename: false,
        clientModified: null,
        mute: false,
        body: stream);
}

 

But, I'm getting a System.MissingFieldException...

 

System.MissingFieldException: Field 'Dropbox.Api.DropboxRequestHandler/<Dropbox.Api.Stone.ITransport.SendUploadRequestAsync>d__d`3<TRequest_REF, TResponse_REF, TError_REF>.<>4__this' not found.
  at Dropbox.Api.Files.Routes.FilesUserRoutes.UploadAsync (Dropbox.Api.Files.CommitInfo commitInfo, System.IO.Stream body) [0x00006] in <4ef505fca4004e3fa64095111cf70e73>:0 
  at Dropbox.Api.Files.Routes.FilesUserRoutes.UploadAsync (System.String path, Dropbox.Api.Files.WriteMode mode, System.Boolean autorename, System.Nullable`1[T] clientModified, System.Boolean mute, System.IO.Stream body) [0x0000d] in <4ef505fca4004e3fa64095111cf70e73>:0 
  at yomomma.Services.DataService+<BackupAsync>d__3.MoveNext () [0x0005a] in /Users/yomomma/Dropbox/dev/yomomma/yomomma.Shared/Services/DataService.cs:111 

I'm using a "Generated Access Token" that I've created on my developer portal. Any ideas as to what is going on here? It's not a helpful error message at all.

 

 

 

 

 

  • I actually just got it working. I had to add the "Microsoft.Bcl.Async" package as well. I noticed some errors in the console saying that "Microsoft.Threading.Tasks" wasn't found. After I added this package, all is well.
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Did you install the Dropbox.Api package? That's not built for Xamarin, but there is a third party version meant for Xamarin: Xamarin.Dropbox.Api. That's made by a third party, so we can't officially support or endorse it, but it may work for you.

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff
        Thanks for confirming that. I just tried this code using v4.3.1 of the SDK in Visual Studio (not Xamarin), and it worked there. That being the case it seems the issue is specific to Xamarin, so I'm afraid I can't offer a solution. I'll send this along as a request for official support for the SDK on Xamarin.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,910 PostsLatest Activity: 3 days ago
333 Following

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 or Facebook.

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!