cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right 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: 

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

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

robertmiles3
Helpful | Level 5
Go to solution

 

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.

 

 

 

 

 

1 Accepted Solution

Accepted Solutions

robertmiles3
Helpful | Level 5
Go to solution
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.

View solution in original post

4 Replies 4

Greg-DB
Dropbox Staff
Go to solution

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.

robertmiles3
Helpful | Level 5
Go to solution

Tried both, same error on both.

Greg-DB
Dropbox Staff
Go to solution
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.

robertmiles3
Helpful | Level 5
Go to solution
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.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    robertmiles3 Helpful | Level 5
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?