Closed srinathvgts closed 1 day ago
@srinathvgts
This issue seems to be related to the local build cache.
try command
flutter clean
flutter pub get
flutter run
from android 14 it need to pass service type when going to startService,
https://developer.android.com/about/versions/14/changes/fgs-types-required#health service type like: healt data_sync ...
I think it's not implemented yet in this plugin.
@timsar2
check readme
You can specify the service type using the android:foregroundServiceType
option as follows:
<!-- required -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!-- foregroundServiceType: dataSync -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<!-- foregroundServiceType: health -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_HEALTH" />
<!-- Warning: Do not change service name. -->
<service
android:name="com.pravera.flutter_foreground_task.service.ForegroundService"
android:foregroundServiceType="dataSync|health"
android:exported="false" />
This plugin uses the ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST value to start the service, so you only need to specify the android:foregroundServiceType
option.
This issue is a known problem, and I believe it has been resolved through a build clean.
I will close this issue.
e: file:///Users/srinathvishgyana/.pub-cache/hosted/pub.dev/flutter_foreground_task-8.14.0/android/src/main/kotlin/com/pravera/flutter_foreground_task/MethodCallHandlerImpl.kt:23:5 Unresolved reference: FlutterForegroundTaskPluginChannel e: file:///Users/srinathvishgyana/.pub-cache/hosted/pub.dev/flutter_foreground_task-8.14.0/android/src/main/kotlin/com/pravera/flutter_foreground_task/MethodCallHandlerImpl.kt:171:5 'init' overrides nothing e: file:///Users/srinathvishgyana/.pub-cache/hosted/pub.dev/flutter_foreground_task-8.14.0/android/src/main/kotlin/com/pravera/flutter_foreground_task/MethodCallHandlerImpl.kt:176:5 'setActivity' overrides nothing e: file:///Users/srinathvishgyana/.pub-cache/hosted/pub.dev/flutter_foreground_task-8.14.0/android/src/main/kotlin/com/pravera/flutter_foreground_task/MethodCallHandlerImpl.kt:180:5 'dispose' overrides nothing