I'm trying to upload a file to dropbox using my flutter mobile app.I get the below error when trying to upload the file to drop box.I'm using the dropbox_client package to access, upload and download a file from dropbox
E/MethodChannel#dropbox( 6383): Failed to handle method call
E/MethodChannel#dropbox( 6383): java.lang.IllegalStateException: URI scheme in your
app's manifest is not set up correctly. You should have a
com.dropbox.core.android.AuthActivity with the scheme: db-o9spra3j1p1cwgk
E/MethodChannel#dropbox( 6383): at
com.dropbox.core.android.AuthActivity.checkAppBeforeAuth(AuthActivity.java:353)
E/MethodChannel#dropbox( 6383): at
com.dropbox.core.android.Auth.startOAuth2Authentication(Auth.java:161)
E/MethodChannel#dropbox( 6383): at
com.dropbox.core.android.Auth.startOAuth2Authentication(Auth.java:147)
E/MethodChannel#dropbox( 6383): at
com.dropbox.core.android.Auth.startOAuth2Authentication(Auth.java:134)
E/MethodChannel#dropbox( 6383): at
com.dropbox.core.android.Auth.startOAuth2Authentication(Auth.java:32)
E/MethodChannel#dropbox( 6383): at
com.dropbox.core.android.Auth.startOAuth2Authentication(Auth.java:24)
E/MethodChannel#dropbox( 6383): at
com.mix1009.dropbox.DropboxPlugin.onMethodCall(DropboxPlugin.java:161)
E/MethodChannel#dropbox( 6383): at
E/MethodChannel#dropbox( 6383): at
io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#dropbox( 6383): at
io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-
flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/MethodChannel#dropbox( 6383): at
io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown
Source:12)
E/MethodChannel#dropbox( 6383): at
android.os.Handler.handleCallback(Handler.java:938)
E/MethodChannel#dropbox( 6383): at
android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#dropbox( 6383): at android.os.Looper.loopOnce(Looper.java:201)
E/MethodChannel#dropbox( 6383): at android.os.Looper.loop(Looper.java:288)
E/MethodChannel#dropbox( 6383): at
android.app.ActivityThread.main(ActivityThread.java:7870)
E/MethodChannel#dropbox( 6383): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#dropbox( 6383): at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/MethodChannel#dropbox( 6383): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
E/flutter ( 6383): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: PlatformException(error, URI scheme in your app's manifest is not set up correctly. You should have a com.dropbox.core.android.AuthActivity with the scheme: db-o9spra3j1p1cwgk, null, java.lang.IllegalStateException: URI scheme in your app's manifest is not set up correctly. You should have a com.dropbox.core.android.AuthActivity with the scheme: db- o9spra3j1p1cwgk E/flutter ( 6383): at com.dropbox.core.android.AuthActivity.checkAppBeforeAuth(AuthActivity.java:353)
Below is my android manifest file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dropbox_test">
<application
android:label="dropbox_test"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<data android:scheme="db-o9spra3j1p1cwgk" />
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
You don't seem to have the necessary URL scheme registered for "com.dropbox.core.android.AuthActivity" in particular. You can find an example here:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.