Skip to content

Adding redirect uri to AndroidManifest throws error about requiring android:exported #885

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
errodevs-ford opened this issue Aug 22, 2023 · 3 comments

Comments

@errodevs-ford
Copy link

Issue

I need to add multiple redirect uris to my application, so I needed to move it from the build.gradle to the android manifest. I followed the documentation and added:

<activity
        android:name="net.openid.appauth.RedirectUriReceiverActivity"
        tools:node="replace">
    <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme="com.example.app"/>
    </intent-filter>
</activity>

But this throws the following error:

android:exported needs to be explicitly specified for element <activity#net.openid.appauth.RedirectUriReceiverActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

I was able to fix it by simply adding android:export to that activity. The documentation should be updated.

    <activity android:name="net.openid.appauth.RedirectUriReceiverActivity" android:exported="true" tools:node="replace">
      <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme="com.example.app"/>
        <data android:scheme="com.example.app2"/>
      </intent-filter>
    </activity

Environment

  • Your Identity Provider: Google / Active Directory
  • Platform that you're experiencing the issue on: Android
  • Are you using Expo? No
@faizplus
Copy link
Contributor

Hi @errodevs-ford, can you please point me to the documentation from where you got this information?

@Siddarthmalemath
Copy link

Siddarthmalemath commented Jun 14, 2024

@errodevs-ford you can refer to this link #611 (comment). it solved the issue.

@carbonrobot
Copy link
Contributor

Closing stale issue

@carbonrobot carbonrobot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants