Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Dropbox SDK manifest setup

Any ideas why I get this error when I call getSession().startAuthentication() for the Android Dropbox SDK?

: FATAL EXCEPTION: main
: java.lang.IllegalStateException: URI scheme in your app's manifest is not set up correctly. You should have a com.dropbox.client2.android.AuthActivity with the scheme: db-CHANGE_ME

Yet my AndroidManifest.xml has the following within the <Application></Application> as instructed in the getting started instructions.

<activity
  android:name="com.dropbox.client2.android.AuthActivity"
  android:launchMode="singleTask"
  android:configChanges="orientation|keyboard">
  <intent-filter>
    <!-- Change this to be db- followed by your app key -->
    <data android:scheme="db-MYKEYISHERE" />
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.BROWSABLE"/>
    <category android:name="android.intent.category.DEFAULT" />
  </intent-filter>
</activity>
like image 683
amcc Avatar asked Apr 08 '13 13:04

amcc


3 Answers

If you're actually seeing "db-CHANGE_ME" (i.e. that's not a placeholder you used to obscure your app key), then it means you haven't updated the app key in the Java code of your app. That error message outputs the key which was provided in the Java code, and expects it to match the key in the manifest.

Your clean build might've picked some Java changes which weren't previously built.

like image 81
Andrew Avatar answered Sep 22 '22 17:09

Andrew


For those facing this problem, if you're like me you might not pay attention to a little detail, take a look at your manifest:

<intent-filter>
    <data android:scheme="db-APP_KEY" />
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.BROWSABLE" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

You shouldn't replace the whole string db-APP_KEY with your app key, you should leave db- there db-{HERE YOUR APP KEY} I know I know, it took me a while to figure out this.

Example:

<intent-filter>
    <data android:scheme="db-hafsa324dasd" />
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.BROWSABLE" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>
like image 40
marcos.borunda Avatar answered Sep 24 '22 17:09

marcos.borunda


When I copied the App_ Key I forgot to add the 'db' part to my answer.

Example:

 <data android:scheme="db-APP_KEY" />

Should be :

 <data android:scheme="db-hafsa324dasd" />

Should Not Be :

<data android:scheme="hafsa324dasd" />
like image 34
CnewBee Avatar answered Sep 20 '22 17:09

CnewBee