android - 应用清单中的 URI 方案未正确设置
问题描述
我正在尝试连接我的 Dropbox,我不知道这个问题来自哪里,但我已经很好地编辑了清单文件!我做错了什么可以请任何人帮助我...
这是我的清单文件:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.JurnalCloudApp">
<activity
android:name=".DropboxActivity"
android:exported="true" />
<activity
android:name=".SyncActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.dropbox.core.android.AuthActivity"
android:configChanges="orientation|keyboard"
android:launchMode="singleTask">
<intent-filter>
<!-- Change this to be db- followed by your app key -->
<data android:scheme="db-is9rikcfjhforcl" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:exported="true"/>
</application>
错误是:
Caused by: 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-db-is9rstkcfjhlorcl
解决方案
你的data android:scheme
样子是对的。根据错误消息,您似乎正在将“db-YOURAPPKEY”传递给启动应用程序授权流程startOAuth2PKCE
的方法,而您应该只指定应用程序密钥,即“YOURAPPKEY”(没有“db- ”)。
如果您在代码中的应用程序密钥中包含该“db-”,SDK 将在您的清单中预期“db-db-is9rstkcfjhlorcl”(带有额外的“db-”),这是不正确的。
推荐阅读
- python-2.7 - 从 PyQt 中的线程修改模型数据
- c# - C# - 为什么在 OnClick 动画之前触发 OnClick 事件?(NuGet - MaterialSkin)
- java - 将java限制为64MB内存
- javascript - Youtube API v3 获取上传某个视频的用户的频道 ID
- python - “TclError: image”,同时将图像添加到标签
- parceljs - 有没有办法像在 Webpack 中一样在 Parcel 中代理请求?
- karate - 空手道 - 匹配两个复杂的洗牌 json
- ios - 在 Swift 4 中显示实时时间标签?
- android-studio - 您必须使用与您要验证的应用程序相同的签名签署一个 apk - blockchainds.com:如何通过 Android Studio 签署 apk 文件?
- java - JFugue 5.0 can't control volume