Skip to content

Fix Play "Broken Functionality": pin minSdk 30; refresh docs after native migration - #20

Merged
timbortnik merged 2 commits into
mainfrom
fix/widget-minsdk30
Jun 6, 2026
Merged

Fix Play "Broken Functionality": pin minSdk 30; refresh docs after native migration#20
timbortnik merged 2 commits into
mainfrom
fix/widget-minsdk30

Conversation

@timbortnik

@timbortnik timbortnik commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Why

Google Play rejected the latest update under the Broken Functionality policy (Jun 5). Root
cause: the home-screen widget's WidgetTheme inherits android:Theme.DeviceDefault.DayNight,
which requires API 29, but minSdk was 24. On Android 7.0–9.0 (API 24–28) the
launcher can't resolve that theme, so both widget layouts (meteogram_widget.xml,
meteogram_widget_weekly.xml) fail to inflate → blank / "can't load widget". Android Lint
confirmed it as the only NewApi error in the project; the app itself launches fine, so the
broken surface is the widget on old Android specifically.

The fix

Pin minSdk = 30 (android/app/build.gradle.kts).

  • Hard floor is 29 (what Theme.DeviceDefault.DayNight needs); 30 was chosen because it also
    gives LocationListener default callbacks.
  • That let us drop the now-redundant onStatusChanged/onProviderEnabled/onProviderDisabled
    stubs, the @Suppress("DEPRECATION"), and an unused import in LocationProvider.kt.
  • Documented in CLAUDE.md (Gotcha Bump actions/upload-artifact from 6 to 7 #9 + Quick Reference) so minSdk isn't lowered again.

keep their last compatible release; nothing is uninstalled.

Verification

  • ./gradlew :app:lintDebug0 NewApi errors (down from 1; the remaining lint error is a
    pre-existing unused-app_name translation note).
  • make analyze → no issues; make test → Dart + Kotlin pass.
  • Built the minSdk-30 APK, installed, launched on an Android 15 (API 35) emulator → no crash;
    dumpsys confirms minSdk=30.
  • Could not reproduce on a real API 24–28 image (none available locally); the lint NewApi signal
    is authoritative.

Docs cleanup (second commit)

The earlier plugin-free migration (home_widgetWidgetStore, geolocator→native
LocationProvider) left the docs describing the old plugin design. This rewrites
docs/ai/widget.md, corrects dependency lists (only http + intl remain), updates
MATERIAL_YOU_COLORS.md, removes the dependabot home_widget pin, fixes dangling links, and
deletes the now-completed EXPEDITED_WORKMANAGER_PLAN.md.

After merge

Tag v1.2.2 to trigger the release workflow and resubmit.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Chores
    • Updated Android minimum SDK requirement to API level 30 for improved compatibility and performance.
    • Refactored widget implementation with native architecture improvements.
    • Simplified location service handling on supported Android versions.
    • Enhanced documentation and updated build configuration for better maintainability.

timbortnik and others added 2 commits June 6, 2026 12:24
The widget's WidgetTheme parent android:Theme.DeviceDefault.DayNight requires
API 29, but minSdk was 24, so on Android 7-9 the launcher could not inflate the
widget — which Google Play flagged as a Broken Functionality violation. Pin
minSdk to 30 (the hard floor is 29; API 30 additionally provides LocationListener
default callbacks, letting us drop the onStatusChanged/onProviderEnabled/
onProviderDisabled stubs and the @Suppress in LocationProvider). Document the
constraint in CLAUDE.md (Gotcha #9) so minSdk isn't lowered again.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The plugin-free migration (home_widget→WidgetStore, geolocator→native
LocationProvider) left the documentation describing the old plugin-based design.
Rewrite docs/ai/widget.md around the native AppWidgetProvider + WidgetStore
implementation; correct the dependency lists in architecture.md/README/SECURITY
(only http + intl remain); update MATERIAL_YOU_COLORS data flow to the native
refresh path; remove the dependabot home_widget ignore rule; fix dangling links
to the already-removed NATIVE_SVG_RENDERING.md/HOME_WIDGET_VERSION_ISSUE.md; and
delete the obsolete EXPEDITED_WORKMANAGER_PLAN.md (that migration is now done).

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

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Worried about impact? Review this PR in Change Stack to explore blast radius before you approve or request changes.

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: b0c0f5cf-0d15-4ab2-b3bf-0c8740c64d12

📥 Commits

Reviewing files that changed from the base of the PR and between a832101 and 14dad5e.

📒 Files selected for processing (13)
  • .coderabbit.yaml
  • .github/dependabot.yml
  • CLAUDE.md
  • README.md
  • SECURITY.md
  • android/app/build.gradle.kts
  • android/app/src/main/kotlin/org/bortnik/meteogram/LocationProvider.kt
  • docs/EXPEDITED_WORKMANAGER_PLAN.md
  • docs/GITHUB_SECURITY_SETUP.md
  • docs/LESSONS_LEARNED.md
  • docs/MATERIAL_YOU_COLORS.md
  • docs/ai/architecture.md
  • docs/ai/widget.md
💤 Files with no reviewable changes (2)
  • docs/EXPEDITED_WORKMANAGER_PLAN.md
  • .github/dependabot.yml

📝 Walkthrough

Walkthrough

This PR documents the completion of a native-first architectural migration, removing Flutter plugin dependencies (home_widget, geolocator, etc.) in favor of native Android implementations. The codebase now enforces minSdk 30, simplifies location services to rely on API 30+ features, and routes widget persistence and refresh through a native Kotlin stack with a WidgetStore bridge.

Changes

Native-First Architecture Migration

Layer / File(s) Summary
Android minSdk 30 baseline and location refactoring
android/app/build.gradle.kts, android/app/src/main/kotlin/org/bortnik/meteogram/LocationProvider.kt, CLAUDE.md
Hard-coded minSdk = 30 with documented rationale. LocationProvider.isLocationServiceEnabled simplified to remove API-level branching and LocationListener stub overrides, relying on API 30+ defaults. Unused imports (android.os.Build, android.os.Bundle) removed.
Native widget implementation architecture
docs/ai/widget.md
Comprehensive documentation of two native AppWidgetProvider implementations (48h and weekly), native Kotlin SVG generation shared with in-app chart, background refresh driven by native Kotlin components (AlarmManager/WorkManager/boot/resize), and Flutter↔native WidgetStore persistence bridge over org.bortnik.meteogram/svg method channel. Added detailed Android Configuration section covering manifest receivers, widget layout/theming via night-qualified resources, and updated debugging guidance.
Material You color and theme handling
docs/MATERIAL_YOU_COLORS.md
Widget re-render path updated to native flow: WidgetUtils.rerenderAllWidgetsNative() triggers SvgChartGenerator regeneration and AppWidgetManager.updateAppWidget() instead of prior Flutter callback path. Dark/light mode now controlled by night-qualified integer resources (chart_light_visibility / chart_dark_visibility). WorkManager dependency bumped to 2.11.2.
Architecture and project documentation
README.md, CLAUDE.md, docs/ai/architecture.md
Dependencies narrowed to http, intl, flutter_localizations with explicit statement that GPS, theming, widget persistence, and storage are implemented natively over org.bortnik.meteogram/svg method channel. Removes references to home_widget, geolocator, geocoding, path_provider, shared_preferences. widget_service.dart now triggers refresh via WidgetStore; AppWidgetProvider replaces HomeWidgetProvider; location service uses native LocationProvider via LocationBridge method channel.
Dependency management and security configuration
.github/dependabot.yml, SECURITY.md, docs/GITHUB_SECURITY_SETUP.md
.github/dependabot.yml reorganizes pub updates into dev-dependencies and minor-and-patch groups, removing home_widget ignore rule. SECURITY.md specifies "Pinned toolchain" (Flutter SDK and Android Gradle Plugin) instead of generic pinned versions, removing home_widget security context. Dependabot troubleshooting updated to require ignore list entries with reason comments.
Cross-reference updates
docs/LESSONS_LEARNED.md, .coderabbit.yaml
Switch "Related docs" references from NATIVE_SVG_RENDERING.md to ai/widget.md in Battery Efficiency and Rendering sections. Test instructions updated to reference WidgetStore instead of home_widget.

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • timbortnik/widget#18: Introduces native LocationProvider and LocationBridge method channel refactoring that this PR documents and enables via the minSdk 30 constraint.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 and specifically summarizes the main change: pinning minSdk to 30 to fix Play Store rejection and updating documentation after native widget migration.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/widget-minsdk30

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

@timbortnik
timbortnik merged commit 95455f0 into main Jun 6, 2026
5 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