【问题标题】:URI scheme in your app's manifest is not set up correctly应用清单中的 URI 方案未正确设置
【发布时间】:2021-12-06 04:40:52
【问题描述】:

我正在尝试连接我的 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

【问题讨论】:

    标签: android schema manifest dropbox-api dropbox-sdk


    【解决方案1】:

    您的data android:scheme 看起来正确。根据错误消息,您似乎将“db-YOURAPPKEY”传递给startOAuth2PKCE 方法to start the app authorization flow,而您应该只指定应用程序密钥,即“YOURAPPKEY”(没有“db- ")。

    如果您在代码中的应用密钥中包含该“db-”,SDK 将在您的 Manifest 中预期“db-db-is9rstkcfjhlorcl”(带有额外的“db-”),这是不正确的。

    【讨论】:

      【解决方案2】:

      嗯我删除了那行的代码(db-),这次遇到了这个错误:

      同样的错误没有两个-db

      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-is9rikcfjhforcl
      

      清单文件:

      <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="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>

       Auth.startOAuth2Authentication(this, this.getString(R.string.app_key));

      和字符串资源:

       &lt;string name="app_key"&gt;is9rikcfjhforcl&lt;/string&gt;

      【讨论】:

        猜你喜欢
        • 2021-04-30
        • 2020-07-31
        • 1970-01-01
        • 1970-01-01
        • 2014-07-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多