Open
Description
Required Reading
- Confirmed
Plugin Version
1.3.8
Flutter Doctor
flutter doctor -v
[✓] Flutter (Channel stable, 3.29.2, on macOS 15.5 24F74 darwin-arm64, locale en-IT) [5.1s]
• Flutter version 3.29.2 on channel stable at /Users/vergara/Downloads/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c236373904 (3 months ago), 2025-03-13 16:17:06 -0400
• Engine revision 18b71d647a
• Dart version 3.7.2
• DevTools version 2.42.3
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [11.6s]
• Android SDK at /Users/vergara/Library/Android/sdk
• Platform android-35, build-tools 35.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.6+-13368085-b895.109)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.3) [5.0s]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16E140
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [22ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.3) [21ms]
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.6+-13368085-b895.109)
[✓] VS Code (version 1.100.3) [18ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.112.0
[✓] Connected device (5 available) [10.7s]
• vergara (wireless) (mobile) • 00008140-001251C63C50801C • ios • iOS 18.5 22F76
• vergara (wireless) (mobile) • 00008110-00115011116A201E • ios • iOS 18.5 22F76
• macOS (desktop) • macos • darwin-arm64 • macOS 15.5 24F74 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 15.5 24F74 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 137.0.7151.69
! Error: Browsing on the local area network for FED-L3RM0WRHF6. Ensure the device is unlocked and attached with a
cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
! Error: Browsing on the local area network for iPhone XR di Ugo. Ensure the device is unlocked and attached with a
cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources [5.3s]
• All expected network resources are available.
• No issues found!
Mobile operating-system(s)
- iOS
- Android
Device Manufacturer(s) and Model(s)
Google Pixel 8a
Device operating-systems(s)
Android 15
What happened?
When I set the TaskConfig delay to monthly I get the error:
"PlatformException(error, java.lang.Long cannot be cast to java.lang.Integer, null, java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer)"
From what I understand it is because the INT in flutter is 64 bit while JobScheduler (native android) has an INT that in Java is 32 bit.
It seems to me that the old AlarmScheduler required a LONG but now it is only used for the < LOLLIPOP versions
Plugin Code and/or Config
void scheduleBackupTask(String backupFrequency) → BackgroundFetch.scheduleTask(
TaskConfig(
taskId: AutomaticBackupTaskId,
delay: switch (backupFrequency) {
"daily" → 86400000, // 1000 * 60 * 60 * 24
"weekly" → 604800000, // 1000 * 60 * 60 * 24 * 7
"monthly" → 2592000000, // 1000 * 60 * 60 * 24 * 30
- → 0,
periodic: true, enableHeadless: true, requiredNetworkType: NetworkType. UNMETERED, requiresBatteryNotLow: false, requiresCharging: false, requiresDeviceIdle: false, requiresNetworkConnectivity: true, requiresStorageNotLow: false,
),);
Relevant log output
PlatformException(error, java.lang.Long cannot be cast to java.lang.Integer, null, java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer)