【问题标题】:Xamarin Android DropBox OAuth2Authentication ErrorXamarin Android DropBox OAuth2Authentication 错误
【发布时间】:2017-07-04 06:24:22
【问题描述】:

我正在尝试使用我的 android 应用程序将文本文件上传到 Dropbox。由 Xamarin & Visual Studio 2017 开发。

当我尝试运行应用程序时,它给出了这个异常

Java.Lang.IllegalStateException:应用清单中的 URI 方案设置不正确。你应该有一个 com.dropbox.client2.android.AuthActivity 的方案:db-zeg38m9cvkcr55y

我的 AndroidManifest.xml

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
         package="DemoDropbox.DemoDropbox"
         android:versionCode="1"
         android:versionName="1.0"
         android:installLocation="auto">
 <uses-sdk android:minSdkVersion="16" />
 <uses-permission android:name="android.permission.INTERNET" />
 <application android:label="DemoDropbox"></application>
 <activity android:name="com.dropbox.client2.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-zeg38m9cvkcr55y" />
     <action android:name="android.intent.action.VIEW" />
     <category android:name="android.intent.category.BROWSABLE" />
     <category android:name="android.intent.category.DEFAULT" />
   </intent-filter>
 </activity>

【问题讨论】:

    标签: c# android xamarin.android visual-studio-2017 dropbox-api


    【解决方案1】:

    经过一番研究,我找到了解决方案。

    “活动”块应该在“应用程序”块内。 AndroidManifest.xml 文件应如下所示。

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" 
              package="DemoFileSync.DemoFileSync" 
              android:versionCode="1" 
              android:versionName="1.0" 
              android:installLocation="auto">
      <uses-sdk android:minSdkVersion="16" />
      <uses-permission android:name="android.permission.INTERNET" />
      <application android:label="DemoFileSync">
        <activity android:name="com.dropbox.client2.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-zeg38m9cvkcr55y" />
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />
          </intent-filter>
        </activity>
      </application>
    </manifest>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-01-08
      • 2017-12-14
      • 1970-01-01
      • 1970-01-01
      • 2021-08-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多