Skip to content

fix: [SDK-4877] preserve WorkDatabase constructor under R8#2685

Merged
fadi-george merged 1 commit into
mainfrom
fadi/sdk-4877
Jul 16, 2026
Merged

fix: [SDK-4877] preserve WorkDatabase constructor under R8#2685
fadi-george merged 1 commit into
mainfrom
fadi/sdk-4877

Conversation

@fadi-george

Copy link
Copy Markdown
Contributor

Description

One Line Summary

Preserve WorkManager’s generated database constructor so AGP 9 release builds do not crash during app startup.

Details

Motivation

Flutter 3.44 projects use AGP 9.0.1 and R8 full mode. With OneSignal’s WorkManager 2.8.1 dependency, R8 can remove the reflectively invoked WorkDatabase_Impl no-argument constructor. The resulting release APK builds successfully but crashes in androidx.startup.InitializationProvider before application initialization.

Scope

Adds one targeted consumer ProGuard rule to the notifications artifact. This preserves Android API 21 support and does not change public APIs or runtime behavior outside minified builds.

Linear: SDK-4877

Testing

Unit testing

No unit test was added because this behavior occurs in R8 output at application startup and cannot be exercised by the SDK unit-test process.

Manual testing

  • Reproduced the crash in a clean Flutter 3.44.1 / AGP 9.0.1 release app consuming Android SDK 5.9.6.
  • Published the fixed SDK artifacts to a temporary local Maven repository and consumed them from the same AGP 9 release app. The app started successfully with no AndroidRuntime error.
  • Ran ./gradlew spotlessCheck :OneSignal:notifications:assembleRelease :app:assembleGmsRelease :app:assembleHuaweiRelease --console=plain.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

📊 Diff Coverage Report

✓ Coverage check passed (no source files changed)

📥 View workflow run

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.

2 participants