Skip to content

Fix ActivityNotFoundException on Android 11+ with browser query intents#24

Merged
Subterrane merged 2 commits intodevelopfrom
fix/android11-browser-queries
Apr 2, 2026
Merged

Fix ActivityNotFoundException on Android 11+ with browser query intents#24
Subterrane merged 2 commits intodevelopfrom
fix/android11-browser-queries

Conversation

@Subterrane
Copy link
Copy Markdown
Collaborator

Summary

  • Add <queries> element to the library manifest declaring VIEW intents for http and https schemes, so AppAuth can discover available browsers on Android 11+ (API 30)
  • Bump compileSdkVersion and targetSdkVersion to 30 across all modules (required for <queries> support)
  • Bump AGP from 3.6.3 to 4.1.3 (AGP < 4.1 cannot parse <queries>)
  • Bump Gradle wrapper from 5.6.4 to 6.7.1 (required by AGP 4.1)

Context

This supersedes PR #22, which correctly identified the root cause (Android 11 package visibility restrictions causing ActivityNotFoundException) but could not work because:

  1. compileSdkVersion remained at 29 — <queries> requires SDK 30+
  2. AGP 4.0.0 (and the project's actual 3.6.3) cannot parse <queries>
  3. The <queries> block was duplicated in demo app manifests (unnecessary since the library manifest is automatically merged)

The <queries> block is placed only in the library manifest (oneloginoidc), which Android's manifest merger propagates to any consuming app automatically. This means library consumers get the fix without any manual configuration.

Backwards compatibility: <queries> is a build-time declaration only. It has no effect on devices running Android 10 or below, and minSdkVersion remains 19.

Test plan

  • Verify project builds successfully with the new AGP/Gradle/SDK versions
  • Verify merged manifest includes <queries> in both demo apps (app and appjava)
  • Test sign-in flow on an Android 11+ device/emulator
  • Test sign-in flow on an Android 10 device/emulator (regression check)

…owser query intents

Android 11 (API 30) introduced package visibility restrictions that cause
PackageManager.queryIntentActivities() to return an empty list unless the
app declares <queries> for the intents it needs. AppAuth uses this to
discover available browsers, so without the declaration the sign-in flow
crashes with ActivityNotFoundException.

This adds <queries> for VIEW intents with http/https schemes to the library
manifest (automatically merged into consumer apps). Also bumps
compileSdkVersion to 30 and AGP to 4.1.3 (both required for <queries>
element support), and updates the Gradle wrapper to 6.7.1.

Supersedes #22. [no-ado]
@Subterrane Subterrane requested a review from eriktalvi as a code owner March 17, 2026 18:16
@Subterrane Subterrane merged commit 3a6265c into develop Apr 2, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

1 participant