Skip to content

fix: silence false-positive Instantiatable lint on ExtensionAppFunctionService#6293

Merged
jamesarich merged 1 commit into
mainfrom
claude/nervous-wilbur-7ada1f
Jul 16, 2026
Merged

fix: silence false-positive Instantiatable lint on ExtensionAppFunctionService#6293
jamesarich merged 1 commit into
mainfrom
claude/nervous-wilbur-7ada1f

Conversation

@jamesarich

@jamesarich jamesarich commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Why

The googleRelease lint vital report (visible in Create or Promote Release → release-google) emits an error that clutters release CI:

androidApp/src/google/AndroidManifest.xml:87: Error: ExtensionAppFunctionService must extend android.app.Service [Instantiatable]

It is non-fatal today only because our lint convention sets abortOnError = false — it does not fail the build, but it pollutes every release lint report with a false positive.

Root cause

The two AppFunctions delegate services we hand-declare (since alpha10 dropped the appfunctions-service manifest) have different superclass chains:

Service Chain Lint resolves?
PlatformAppFunctionService androidx.appfunctions.AppFunctionServiceandroid.app.appfunctions.AppFunctionService (compile SDK, API 36) ✅ resolves to android.app.Service — no warning
ExtensionAppFunctionService ExtensionsAppFunctionService (abstract) → com.android.extensions.appfunctions.AppFunctionService (device <uses-library> sidecar) ❌ unresolvable

com.android.extensions.appfunctions.AppFunctionService is supplied at runtime by the optional com.android.extensions.appfunctions shared library — declared <uses-library android:required="false" /> in the appfunctions AAR manifest — and follows the AndroidX convention for OEM on-device sidecars (com.android.extensions.<feature>, kept off the boot classpath). It is not shipped in any compile/lint-classpath artifact, so lint cannot follow the superclass chain up to android.app.Service and false-positives. Only ExtensionAppFunctionService is affected (confirmed by reproduction).

Making the dependency "visible to lint" is therefore a dead end — there is no artifact to add; the class only exists on-device via <uses-library>.

Changes

🐛 Bug Fixes

  • Add a narrow tools:ignore="Instantiatable" to only the ExtensionAppFunctionService <service> element in androidApp/src/google/AndroidManifest.xml, with a comment explaining the <uses-library> sidecar chain. The check stays active on PlatformAppFunctionService and on all our own components, so this is the most surgical option (preferred over a scoped lint { disable } or a baseline).

Testing Performed

Local verification on the googleRelease variant (JDK 25):

  • ./gradlew :androidApp:lintVitalGoogleRelease -Pci=true0 errors, 0 warnings (was 1 error — the [Instantiatable] error is gone)
  • ./gradlew spotlessCheck → pass
  • ./gradlew detekt → pass

Independent from the R8 proguard fix in #6292 — no overlap.

Summary by CodeRabbit

  • Bug Fixes
    • Resolved an Android manifest tooling warning related to the app functions service.
    • No changes were made to service behavior, permissions, availability, or exported status.

…onService

The googleRelease lint vital report emitted a (non-fatal) error:
  ExtensionAppFunctionService must extend android.app.Service [Instantiatable]

ExtensionAppFunctionService's superclass chain ends at
com.android.extensions.appfunctions.AppFunctionService, a class supplied at
runtime by the optional `com.android.extensions.appfunctions` <uses-library>
(android:required="false" in the appfunctions AAR), not by any
compile/lint-classpath artifact. Lint cannot follow a <uses-library>-provided
superclass, so it can't prove the service is a Service and false-positives.

Add a narrow tools:ignore="Instantiatable" to only that <service> element,
with a comment explaining the sidecar chain. The sibling
PlatformAppFunctionService resolves cleanly (its chain ends in the compile-SDK
android.app.appfunctions.AppFunctionService), so the check stays active there
and on all our own components.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d2f8868c-1074-4734-9b34-a7f15420ef65

📥 Commits

Reviewing files that changed from the base of the PR and between 7849f34 and f3aabf8.

📒 Files selected for processing (1)
  • androidApp/src/google/AndroidManifest.xml

📝 Walkthrough

Walkthrough

The Google flavor Android manifest adds tools:ignore="Instantiatable" to the App Functions service and expands its explanatory comment. Existing service configuration remains unchanged.

Changes

Manifest lint suppression

Layer / File(s) Summary
App Functions service declaration
androidApp/src/google/AndroidManifest.xml
Adds the Instantiatable lint suppression and documents the optional runtime-provided superclass dependency while preserving the service configuration.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: silencing a false-positive Instantiatable lint warning for ExtensionAppFunctionService.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jamesarich
jamesarich marked this pull request as ready for review July 16, 2026 12:16
@jamesarich
jamesarich enabled auto-merge July 16, 2026 12:16
@jamesarich
jamesarich disabled auto-merge July 16, 2026 12:27
@jamesarich
jamesarich merged commit 1e611e0 into main Jul 16, 2026
6 checks passed
@jamesarich
jamesarich deleted the claude/nervous-wilbur-7ada1f branch July 16, 2026 12:27
@github-actions github-actions Bot added the bugfix PR tag label Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant