java azure storage error “enumerating the result”

后端 未结 1 1904
小鲜肉
小鲜肉 2021-01-28 21:02

I\'m consuming the android azure storage API with the following code:

try
{
    // Retrieve storage account from connection-string.
    CloudStorageAccount stora         


        
相关标签:
1条回答
  • 2021-01-28 21:14

    First things first, lets check off the basics that tend to cause odd errors. :)

    1. Could you confirm you're using the Android library and not the Java library?
    2. Could you confirm you have internet permissions in your Android manifest? See our samples for an example.

    If neither of these are your issues, then could you do the following?

    1. Post the full exception trace. The iterable API requires us to return a NoSuchElementException, so we wrap the reason the exception actually occurred into that. The full stack trace should give us what we need to debug further.
    2. Post the version of the Android library you're using and the version of Android you're running on. Per the changelog we've had some Android bugs relating to iterables in the past and this will let us confirm you're not hitting those.

    Leaving the debugging steps for others, but here the full stack trace gives the answer. In the full strack trace you can see a NetworkOnMainThreadException with the message 'Network operations may not be performed on the main thread.' Because network operations can be slow, Android prevents them from being made on the main thread by default. If you search this error you'll find a variety of examples on how to work with network operations without blocking the UI thread.

    0 讨论(0)
提交回复
热议问题