[英]URI scheme in your app's manifest is not set up correctly Error
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我正在尝试使用我的 flutter 移动应用程序将文件上传到保管箱。尝试将文件上传到保管箱时出现以下错误。我正在使用 dropbox_client package 从保管箱访问、上传和下载文件
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) E/flutter (6383): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] 未处理的异常:PlatformException(错误,您的应用清单中的 URI 方案设置不正确。您应该有一个 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): 在 com.dropbox.core.android.AuthActivity.checkAppBeforeAuth(AuthActivity.Z93F725A07423D11C486)
Below is my android manifest file下面是我的 android 清单文件
<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.您似乎没有特别为“com.dropbox.core.android.AuthActivity”注册必要的 URL 方案。 You can find an example here:
你可以在这里找到一个例子:
https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/DropboxAndroid/app/src/main/AndroidManifest.xml https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/DropboxAndroid/app/src/main/AndroidManifest.xml
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.