You should have a com.dropbox.client2.android.AuthActivity with the scheme:XXXXXXXX

早过忘川 提交于 2019-12-12 07:22:32

问题


I am trying to upload a text file to my Dropbox, but it shows an error in manifest. This is my Manifest file and the logcat error, what am I doing wrong can anyone help me please...

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.ondropbox"
  android:versionCode="1"
  android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"></uses-permission>
    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <activity
        android:name="com.example.ondropbox.MainActivity"
        android:launchMode="singleTask"
        android:configChanges="orientation|keyboard" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />


            <data android:scheme="db-5qiq4z06ikagxfb" />
    <category android:name="android.intent.category.BROWSABLE"/>
        <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
</application>
</manifest>

The Error is:

**java.lang.IllegalStateException: URI scheme in your app's manifest is not set up correctly. You should have a com.dropbox.client2.android.AuthActivity with the scheme: db-5qiq4z06ikagxfb**

What should I do?

Thanks for any kind of help.


回答1:


because you are missing to add activity,,,

 <activity
        android:name="com.example.ondropbox.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.dropbox.client2.android.AuthActivity"
        android:configChanges="orientation|keyboard"
        android:launchMode="singleTask" >
        <intent-filter>
            <data android:scheme="db-5qiq4z06ikagxfb" />

            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

and you are done.




回答2:


I had a very similar issue after migrating my app from Dropbox API v1 to v2. I used an official tutorial for migration - https://www.dropbox.com/developers/reference/migration-guide, but there are no word about Android, only basic examples in Java. So I opened this GitHub repo and used it as reference - https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/android.

But in new API they changed a package of AuthActivity and I forgot to check, so had a Runtime crash - Unable to find com.dropbox.core.android.AuthActivity.

The solution is to change old package to new one - com.dropbox.client2.android.AuthActivity to com.dropbox.core.android.AuthActivity.



来源:https://stackoverflow.com/questions/20770049/you-should-have-a-com-dropbox-client2-android-authactivity-with-the-schemexxxxx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!