<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error downloading multiple files from dropbox to the phone via the Sync API in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68782#M2061</link>
    <description>&lt;P&gt;Also, yes I am using the latest Android Sync SDK v3.1.2.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Feb 2015 20:28:43 GMT</pubDate>
    <dc:creator>Mob A.</dc:creator>
    <dc:date>2015-02-10T20:28:43Z</dc:date>
    <item>
      <title>Error downloading multiple files from dropbox to the phone via the Sync API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68779#M2058</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to sync a specific folder from dropbox to the mobile using the Sync API in my Android app. I use the listFolder method to get the contents of the folder and then iterate over the dbxPaths to  download each of them. This works but sometimes I get the following fatal error:&lt;/P&gt;

&lt;P&gt;02-05 10:45:30.014: E/libDropboxSync.so(err)(12094): ASSERTION FAILED: 'path-&amp;gt;m_refcount' is false, should have been true&lt;/P&gt;

&lt;P&gt;Any idea why this is happening? ANy help will be appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:45:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68779#M2058</guid>
      <dc:creator>Mob A.</dc:creator>
      <dc:date>2019-05-29T09:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Error downloading multiple files from dropbox to the phone via the Sync API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68780#M2059</link>
      <description>&lt;P&gt;Thanks for the report. First, can you confirm that you're using the latest version of the &lt;A href="https://www.dropbox.com/developers/sync/sdks/android" rel="nofollow noreferrer"&gt;Android Sync SDK&lt;/A&gt;, currently v3.1.2?&lt;/P&gt;

&lt;P&gt;Also, is this related to your &lt;A href="https://www.dropboxforum.com/hc/communities/public/questions/201675909-Error-downloading-multiple-files-from-dropbox-to-the-phone-via-the-Sync-API" rel="nofollow noreferrer"&gt;other question&lt;/A&gt; or should we consider this a separate issue?&lt;/P&gt;

&lt;P&gt;In any case, if you can supply the relevant code snippet(s) that should be helpful.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2015 05:57:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68780#M2059</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-02-06T05:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error downloading multiple files from dropbox to the phone via the Sync API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68781#M2060</link>
      <description>&lt;P&gt;Hi Greg,&lt;/P&gt;

&lt;P&gt;Here's the code snippet:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Type type = new TypeToken&amp;lt;List&amp;lt;DbxFileInfo&amp;gt;&amp;gt;(){}.getType();
List&amp;lt;DbxFileInfo&amp;gt; dbxFileInfoList = gson.fromJson(restoredData, type);

DbxPath path = null;

DbxFileInfo fileInfo = null;
File restoredFile = null;
int numOfFiles = dbxFileInfoList.size();
FileChannel src = null;
FileChannel dst = null;

try {
    DbxFileSystem dbxFs = DbxFileSystem.forAccount(MyApplication.mDbxAcctMgr.getLinkedAccount());

    for(int i = 0; i &amp;lt; numOfFiles; i++)
    {
        //fileInfo = dbxFileInfoList.get(i);
        DbxFile testFile = null;
        path = dbxFileInfoList.get(i).path;

        if(!dbxFs.isFile(path))
        {
            break;
        }

        testFile = dbxFs.open(path);
        restoredFile = new File(Constants.APP_DIR,path.getParent() + "/" +  path.getName());

        if(!restoredFile.exists())
        {
            src = testFile.getReadStream().getChannel();
            dst = new FileOutputStream(restoredFile).getChannel();
            dst.transferFrom(src, 0, src.size());
            createSessionWithAudio(restoredFile.getAbsolutePath(), dbxFileInfoList.get(i).modifiedTime, dbxFileInfoList.get(i).size);
        }
        src.close();
        testFile.close();
        dst.close();
        restoreCount++;
    }

    dbxFs.shutDown();

} catch (Unauthorized e) {
    Log.e(TAG, "Unathorized Dropbox access");
} catch (InvalidPathException e) {
    Log.e(TAG, "Invalid Dropbox file path");
} catch (DbxException e) {
    Log.e(TAG, "Dropbox exception");
} catch (IOException e) {
    Log.e(TAG, "IO exception during dropbox sync");
}
catch(Exception e)
{
    Log.e(TAG, "Exception during dropbox sync");
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The code being run for the other question is the same. However, the issues are separate.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2015 18:40:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68781#M2060</guid>
      <dc:creator>Mob A.</dc:creator>
      <dc:date>2015-02-10T18:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error downloading multiple files from dropbox to the phone via the Sync API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68782#M2061</link>
      <description>&lt;P&gt;Also, yes I am using the latest Android Sync SDK v3.1.2.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2015 20:28:43 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68782#M2061</guid>
      <dc:creator>Mob A.</dc:creator>
      <dc:date>2015-02-10T20:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Error downloading multiple files from dropbox to the phone via the Sync API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68783#M2062</link>
      <description>&lt;P&gt;Thanks for the code! Based on &lt;CODE&gt;gson.fromJson(restoredData, type);&lt;/CODE&gt;, it looks like you're using some sort of sort of serialization framework to store and retrieve &lt;CODE&gt;DbxFileInfo&lt;/CODE&gt; to/from JSON, is that correct? We don't explicitly support that, and it's possible that this is causing the issue. Can you try it without that part? &lt;/P&gt;

&lt;P&gt;Also, can you elaborate a bit on why you're trying to store and retrieve this information like this anyway? The SDK caches metadata for you, so you can even access it offline.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Feb 2015 03:17:46 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68783#M2062</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-02-12T03:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Error downloading multiple files from dropbox to the phone via the Sync API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68784#M2063</link>
      <description>&lt;P&gt;Hi Greg,&lt;/P&gt;

&lt;P&gt;Essentially, I want to allow the user an option to retrieve backed up files from a specific folder from Dropbox when he reinstalls my app or installs it on another device. I serialize the list of available files since I do not want to run the 'listFolder' query repeatedly. I doubt there is an issue with the serialization since the same code works 2 out of 3 times.&lt;/P&gt;

&lt;P&gt;I tried running the code without the deserialization part with the same result. The code crashes in libDropboxSync.so once in 3 times (on an average).&lt;/P&gt;

&lt;P&gt;I am new to the Sync API. Is there a better way of providing the functionality I mentioned in the first paragraph by using the Sync API itself? I believe the API does not have a method to download all files from a specific folder.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Feb 2015 15:00:36 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68784#M2063</guid>
      <dc:creator>Mob A.</dc:creator>
      <dc:date>2015-02-12T15:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Error downloading multiple files from dropbox to the phone via the Sync API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68785#M2064</link>
      <description>&lt;P&gt;The metadata is cached, so there's no harm in calling &lt;CODE&gt;listFolder&lt;/CODE&gt; as much as needed. We definitely don't recommend serializing/deserializing the objects though, as there is some special initialization that occurs, which you won't get when deserializing and could cause problems.&lt;/P&gt;

&lt;P&gt;Anyway, you're correct that there's currently no way to download an entire folder at once besides looping through all the desired files and opening them. The Sync SDK wasn't designed with a convenient way to do so since it was meant for mobile devices and the intent was that data would only be downloaded if/when necessary (e.g., when the user wants to interact a particular file's content). &lt;/P&gt;

&lt;P&gt;Can you post your new code without the serializing/deserializing so we can continue investigating? (It may be worth uninstalling/reinstalling the app in case you have some corrupt state due to that.)&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2015 03:54:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68785#M2064</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-02-13T03:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error downloading multiple files from dropbox to the phone via the Sync API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68786#M2065</link>
      <description>&lt;P&gt;Greg,&lt;/P&gt;

&lt;P&gt;My apologies for the delayed response. &lt;/P&gt;

&lt;P&gt;The code works reliably if the serialization is removed. Thanks for the help.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Neeraj&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 14:52:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-downloading-multiple-files-from-dropbox-to-the-phone-via/m-p/68786#M2065</guid>
      <dc:creator>Mob A.</dc:creator>
      <dc:date>2015-02-17T14:52:24Z</dc:date>
    </item>
  </channel>
</rss>

