question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ActivityNotFoundException during authentication started to raise with Android 13.

See original GitHub issue

On 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:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kotoMJcommented, Sep 30, 2022

Yeah, it’s https://play.google.com/store/apps/details?id=com.aisense.otter&hl=en&gl=US

On 30. 9. 2022, at 16:59, Sam Edwards @.***> wrote:

@kotoMJ https://github.com/kotoMJ - Can I inquire what application you are using the SDK in? Do you have a link to the Play Store listing? Thanks!

— Reply to this email directly, view it on GitHub https://github.com/dropbox/dropbox-sdk-java/issues/461#issuecomment-1263686645, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCNVUAG62UIJGQNKBCWIGDWA356FANCNFSM6AAAAAAQZUHLPU. You are receiving this because you were mentioned.

1reaction
handstandsamcommented, Sep 30, 2022

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - ActivityNotFoundException while sending email from ...
It means that the android system doesnt found any email sending activity to handle the intent created by you. Make sure you have...
Read more >
ActivityNotFoundException - Android Developers
This exception is thrown when a call to Context#startActivity or one of its variants fails because an Activity can not be found to...
Read more >
How to Solve Android's 13 Most Common Error Messages
However, spotting errors that appear in Android Studio can be tricky, ... to know where to start looking for the source of the...
Read more >
Android Developers on Twitter: " What should you know ...
What should you know about intent filters in #Android13? ... upgrading targetSdk to 33 Android tests on Android 13 device start to fail...
Read more >
Android 13 'Tiramisu': Everything you need to know about ...
Android 13 Developer Preview. We got a taste of Android 13 "Tiramisu" for the first time on February 10, 2022, when Google started...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found