<?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: Migrate from V1 to V2 API Crash on DropboxClientFactory.init(accessToken); in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Migrate-from-V1-to-V2-API-Crash-on-DropboxClientFactory-init/m-p/236762#M13066</link>
    <description>Can you share the full error message and stack trace for the crash? Thanks in advance!</description>
    <pubDate>Mon, 14 Aug 2017 15:05:00 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2017-08-14T15:05:00Z</dc:date>
    <item>
      <title>Migrate from V1 to V2 API Crash on DropboxClientFactory.init(accessToken);</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Migrate-from-V1-to-V2-API-Crash-on-DropboxClientFactory-init/m-p/236620#M13056</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So first I&amp;nbsp;removed from my android app all V1 API code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an eclipse project. &amp;nbsp;I added all .jar files for V2 API 3.0.3 and dependencies.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I looked at the example (which has no comments).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So for now i have just placed all authentication into my OnResume. But it crashes when executing &lt;SPAN&gt;DropboxClientFactory.init(accessToken);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I start the App, open the settings and enable dropbox, this then passes message&amp;nbsp;MESSAGE_AUTHENTICATE_DROPBOX which implements&amp;nbsp;Auth.startOAuth2Authentication(BluetoothChat.this, APP_KEY) and i get the AuthActivity and I authorise, then onResume gets the access token and then it closes.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if i step through with the debugger then when&amp;nbsp;&amp;nbsp;DropboxClientFactory.init(accessToken) is called the debugger jumps to super.onResume() and then the app closes.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the onResume:-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;@Override
public synchronized void onResume() {
&amp;nbsp; super.onResume();
&amp;nbsp; if(D) Log.e(TAG, "+ ON RESUME +");

&amp;nbsp; boolean dropBoxState=Prefs_DropBox; //Save Dropbox Prefs State before reload prefs

&amp;nbsp; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
&amp;nbsp; String accessToken = prefs.getString("access-token", null);
&amp;nbsp; if (accessToken == null) {
&amp;nbsp; &amp;nbsp; accessToken = Auth.getOAuth2Token();
&amp;nbsp; &amp;nbsp; if (accessToken != null) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; prefs.edit().putString("access-token", accessToken).apply();
&amp;nbsp; &amp;nbsp; &amp;nbsp; prefs.edit().putBoolean("DropboxIntegration", true).commit();
&amp;nbsp; &amp;nbsp; &amp;nbsp; DropboxClientFactory.init(accessToken);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PicassoClient.init(getApplicationContext(),com.dropbox.core.examples.android.DropboxClientFactory.getClient());
}
} else {
&amp;nbsp; DropboxClientFactory.init(accessToken);
&amp;nbsp; PicassoClient.init(getApplicationContext(), com.dropbox.core.examples.android.DropboxClientFactory.getClient());
}

if(D) Log.e(TAG, "LoadPrefs");
LoadPrefs();

if (Prefs_DropBox) {
&amp;nbsp; if (!dropBoxState) //Dropbox has just been enabled
&amp;nbsp; {
&amp;nbsp; &amp;nbsp; mHandler.obtainMessage(MESSAGE_AUTHENTICATE_DROPBOX).sendToTarget();
&amp;nbsp; &amp;nbsp; //Disable again until Authentication completes!
&amp;nbsp; &amp;nbsp; prefs.edit().putBoolean("DropboxIntegration", false).commit();
}

}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2020 17:16:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Migrate-from-V1-to-V2-API-Crash-on-DropboxClientFactory-init/m-p/236620#M13056</guid>
      <dc:creator>swright1512</dc:creator>
      <dc:date>2020-05-29T17:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Migrate from V1 to V2 API Crash on DropboxClientFactory.init(accessToken);</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Migrate-from-V1-to-V2-API-Crash-on-DropboxClientFactory-init/m-p/236762#M13066</link>
      <description>Can you share the full error message and stack trace for the crash? Thanks in advance!</description>
      <pubDate>Mon, 14 Aug 2017 15:05:00 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Migrate-from-V1-to-V2-API-Crash-on-DropboxClientFactory-init/m-p/236762#M13066</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-08-14T15:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Migrate from V1 to V2 API Crash on DropboxClientFactory.init(accessToken);</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Migrate-from-V1-to-V2-API-Crash-on-DropboxClientFactory-init/m-p/236807#M13072</link>
      <description>&lt;P&gt;Greg,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for getting back to me. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the crash i had was an ADB or Driver issue. &amp;nbsp;the authentication worked ok when i ran without the debugger. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had not used my LG G6 to debug before. &amp;nbsp;I used the debugger with an old Motorolla E and it authenticated ok. &amp;nbsp;Maybe I need to update the android SDK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I now have authentication and AsyncTask that uploads all files matching a pattern for a given folder so I am now close to deprecating API V1 from my application.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 19:23:36 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Migrate-from-V1-to-V2-API-Crash-on-DropboxClientFactory-init/m-p/236807#M13072</guid>
      <dc:creator>swright1512</dc:creator>
      <dc:date>2017-08-14T19:23:36Z</dc:date>
    </item>
  </channel>
</rss>

