ActivityNotFoundException during authentication started to raise with Android 13.
See original GitHub issueOn the project we have been using com.dropbox.core:dropbox-core-sdk:3.1.1 for quite a while. It’s used together with dropboxChooserSDK module which contains just ActivityLike, AppStoreInterstitial and DbxChooser. Definition of com.dropbox.core.android.AuthActivity is directly in the Manifest of the app module.
Everything worked fine until targeting Android 13(which forced us to define exported flag). We had an option to set either exported false or true.
<activity
android:name="com.dropbox.core.android.AuthActivity"
android:configChanges="keyboard"
android:launchMode="singleTask"
android:theme="@style/AppTheme"
android:exported="true">
<intent-filter>
<data android:scheme="db-${dropBoxApiKey}" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
When exported false, compiler force us remove android.intent.action.VIEW which then any attempt to authenticate by calling Auth.startOAuth2Authentication(context, BuildConfig.DROPBOX_API_KEY)
cause immediate crash
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-ourDropBoxApiKey
When exported true, then dropbox authentication starts with screen for allowing access to it’s own folder. There is a title on the creen: OurApp would like access to its own folder, Apps > OurApp, inside your Dropbox. Pressing Allow button causes following issue:
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.ourapp.domain/com.dropbox.core.android.AuthActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.ourapp.domain/com.dropbox.core.android.AuthActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2158)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1805)
at android.app.Activity.startActivityForResult(Activity.java:5470)
at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:2)
at android.app.Activity.startActivityForResult(Activity.java:5428)
at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:1)
at android.app.Activity.startActivity(Activity.java:5926)
at android.app.Activity.startActivity(Activity.java:5893)
at dbxyzptlk.Ae.a.e(RealSafeIntentStarter.java:3)
at com.dropbox.android.dauth.DelegatedAuthActivity$j$c.a(DelegatedAuthActivity.java:9)
at com.dropbox.android.dauth.DelegatedAuthActivity$j.a(DelegatedAuthActivity.java:2)
at dbxyzptlk.xh.c.onPostExecute(DbxAsyncTask.java:10)
at android.os.AsyncTask.finish(AsyncTask.java:771)
at android.os.AsyncTask.-$$Nest$mfinish(Unknown Source:0)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7898)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Not sure if there is some way to adjust intent filters. I tried to upgrade to version 4.0.1 of the SDK and play a bit with filters. But I was not successful so far.
Our app has a lot of active Android users and missing support of DropBox for those who are targeting Android 13 is really bad.
If there is some other way how to solve support for Android 13, pls. let me know.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Yeah, it’s https://play.google.com/store/apps/details?id=com.aisense.otter&hl=en&gl=US
There is a fix on the Dropbox App side that went into the version released on September 22nd v298.2.2. More details regarding that in the other ticket as well: https://github.com/dropbox/dropbox-sdk-java/issues/406
I’m going to close this as a duplicate of https://github.com/dropbox/dropbox-sdk-java/issues/406, but thank you for asking, and I’m glad it worked!