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>
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.
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>
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" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With