Skip to content

Conversation

@x15sr71
Copy link

@x15sr71 x15sr71 commented Oct 23, 2025

Description

This PR fixes the Android build failure caused by deprecated Gradle plugin configurations and modernizes the project's entire dependency stack. The build system has been updated to comply with current Flutter and Gradle standards, and all packages have been brought up to their latest stable versions.

Proposed Changes

Build System Modernization:

  • Migrated android/settings.gradle and android/build.gradle from deprecated imperative plugin loading (apply script) to modern declarative plugins {} block
  • Updated Gradle wrapper from 8.3 to 8.10
  • Updated Android Gradle Plugin (AGP) to 8.7.2
  • Updated Kotlin to 2.1.0
  • Bumped compileSdkVersion from 34 to 36
  • Removed deprecated flutterRoot SDK path resolution (now handled automatically)
  • Added proper namespace declaration in build.gradle
  • Updated Java compatibility to version 17

Google Sign-In Refactor:

  • Completely refactored Google Sign-In implementation to work with google_sign_in ^7.2.0
  • Replaced deprecated sign-in methods with modern GoogleSignIn.instance.initialize() and authenticate() flow
  • Updated authentication flow to use authenticationEvents stream for better state management
  • Fixed authorization scope requests to use authorizationClient.authorizeScopes()
  • Added proper error handling and user feedback during sign-in process

Firebase & Cloud Dependencies:

  • Updated firebase_core from 2.27.0 to 4.1.1
  • Updated firebase_auth from 4.17.8 to 6.1.0
  • Updated firebase_messaging from 14.7.19 to 16.0.2
  • Updated cloud_firestore from 4.4.5 to 6.0.2
  • Updated googleapis from 13.1.0 to 15.0.0
  • Updated googleapis_auth from 1.4.1 to 2.0.0
  • Updated extension_google_sign_in_as_googleapis_auth from 2.0.12 to 3.0.0

Package Updates (Major Versions):

  • get: 4.6.6 → 4.7.2
  • intl: 0.18.0 → 0.20.2
  • flutter_map: 4.0.0 → 8.2.2
  • latlong2: 0.8.1 → 0.9.1
  • fl_location: 2.0.0+1 → 5.0.0
  • flutter_fgbg: 0.3.0 → 0.7.1
  • flutter_secure_storage: 8.0.0 → 9.2.4
  • weather: 2.0.1 → 3.2.1
  • shake: 2.2.0 → 3.0.0
  • mobile_scanner: 3.5.5 → 7.1.2
  • permission_handler: 11.0.1 → 12.0.1
  • flutter_expandable_fab: 1.8.1 → 2.5.2
  • vibration: 1.8.1 → 3.1.4
  • file_picker: 6.1.1 → 10.3.3
  • audioplayers: 5.2.1 → 6.5.1
  • sensors_plus: 1.4.1 → 6.1.2
  • rxdart: 0.27.7 → 0.28.0
  • fluttertoast: 8.2.5 → 9.0.0
  • audio_session: 0.1.18 → 0.2.2
  • android_intent_plus: 5.0.2 → 6.0.0
  • flutter_lints: 4.0.0 → 6.0.0

Code Quality & Bug Fixes:

  • Fixed StateError crash in notification_icon.dart by adding comprehensive null safety checks
  • Added proper snapshot validation: snapshot.hasError, snapshot.hasData, snapshot.data!.exists, data.containsKey()
  • Updated flutter_map usage to new API (initialCenter and initialZoom instead of deprecated center and zoom)
  • Updated Marker widget to use child property instead of deprecated builder
  • Fixed flutter_fgbg usage to use FGBGEvents.instance.stream instead of deprecated FGBGEvents.stream
  • Updated shake detector callback signature to accept ShakeEvent parameter
  • Updated AudioContext to be non-const as required by newer audioplayers package
  • Fixed Firestore user document to use Google ID instead of email as document ID (better practice)
  • Added proper error handling for Firestore operations with user-friendly fallbacks

Configuration Updates:

  • Updated macOS minimum platform version from 10.14 to 10.15
  • Cleaned up unused Kotlin version references in build.gradle
  • Updated .gitignore to include .build/ and .swiftpm/ directories
  • Updated Google Services configuration file with new Firebase project credentials

Fixes #852

Testing Notes

  • App builds successfully on Android
  • Google Sign-In flow working correctly with new authentication API
  • All existing features functional with updated dependencies
  • No breaking changes in user-facing functionality
  • Tested on Android emulator (sdk gphone64 arm64)

Screenshots

Note on Scope and Testing

Fixing the initial Android build failure (caused by the deprecated Gradle plugin method) required updating the core Android build system (Gradle, Kotlin, SDK versions). This modernization naturally led to a comprehensive update across Flutter dependencies in pubspec.yaml, as many packages needed to align with the newer build toolchain.

This brings the project fully up-to-date with current tooling and dependency versions.

I've performed testing across different phone and tablet emulators and physical devices, covering core functionality and areas touched by the updated packages:

  • Build: Android build completes successfully
  • Authentication: Google Sign-In, Sign-Out (Unlinking), and Profile Creation
  • Basic Alarms: Creating, viewing, enabling/disabling basic alarms, including settings like "Ring On," "Repeat," "Snooze," "Delete After Goes Off," "Label," "Note," "Choose Ringtone," and "Show Motivational Quote"
  • Alarm Challenges:
    • Shake to Dismiss
    • QR/Barcode Scanning
    • Math Problems
    • Pedometer Steps
  • Guardian Angel: Both SMS and Call functionalities

The testing confirms all major features are functioning as expected. As with any dependency update, additional validation on edge cases or specific device configurations during code review is always beneficial. I'm available to address any feedback or questions during the review process.


Note

The updates in the macos/ and ios/ directories (including Podfile, .xcodeproj, and related build configurations) were automatically generated after upgrading Flutter dependencies and re-running CocoaPods integration (flutter pub get → pod install).

These changes were not manual edits but were required to ensure compatibility with updated package versions and the latest macOS deployment target.

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing
  • Build system successfully updated to modern standards
  • All package dependencies updated to latest stable versions
  • Breaking API changes properly handled and tested

@x15sr71 x15sr71 force-pushed the fix/android-build-and-deps-update branch from dd25af3 to 167dd2d Compare October 25, 2025 11:14
@x15sr71
Copy link
Author

x15sr71 commented Oct 26, 2025

Hi @mahendra-918 @MarkisDev, just a gentle reminder to review this PR whenever you get a chance. Thank you!

@x15sr71
Copy link
Author

x15sr71 commented Nov 9, 2025

Hi @cfsmp3 ,
Hope you're doing well! I wanted to follow up on this PR, it's been a couple of weeks and it fixes the Android build issue
that's currently blocking development and updates the project to current stable packages.
I noticed you merged a similar Flutter PR in firebase_editor previously, so I thought you might be able to help with this one as well.
For additional context, here's the Zulip discussion.
Thanks so much for your time!

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.

Fix: Android Build Failure Due to Deprecated Gradle Plugin Configuration

1 participant