JulianAssmann / flutter_background

A flutter plugin to keep apps running in the background via foreground services. Android only.
https://pub.dev/packages/flutter_background
MIT License
89 stars 52 forks source link

[BUG] Release 1.2.0 is broken #69

Closed boldt closed 3 months ago

boldt commented 1 year ago

Describe the bug

The release 1.2.0 is broken on real devices (Pixel/Samsung/Motorola). The always-visible-notification is not shown anymore and the app stopps working after some time.

Workaround

Downgrading back to 1.1.0 and the apps works again as expected.

PeterNjeim commented 1 year ago

Can confirm on Xiaomi Mi 9T Pro running Pixel-based Android 13 custom ROM. No notification is displayed

Sembauke commented 1 year ago

@boldt Which version of Android are you using?

boldt commented 1 year ago

Android 12

den0206 commented 1 year ago

same issue, not show notification.

jakoss commented 1 year ago

The Service is removed from manifest, look here: https://github.com/JulianAssmann/flutter_background/commit/fcce0d57525802b6f720dee0a080a10a0feaca4b#diff-93083d0574bec8be4b25f798b65dd82a612412c23a79dc9bdfdfb4a6b7ab37a3L3-L13

It shouldn't be removed. The workaround is to add it to your manifest:

<service
    android:name="de.julianassmann.flutter_background.IsolateHolderService"
    android:exported="false" />

But the changes i've linked should definitely be reversed

vmwsree commented 1 year ago

I downgraded but its a new app so kotlin error, does that mean I need to have support for android 13 or can I do some simple fix

┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────┐ │ [!] Your project requires a newer version of the Kotlin Gradle plugin. │ │ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then │ │ update /Users/vmwsree/VIVEK-Personal/lab/letsgocamp/android/build.gradle: │ │ ext.kotlin_version = '<latest-version>'

JulianAssmann commented 3 months ago

Thank you for creating this issue. Sorry for the long delay, I'm very busy at work right now.

I just released a new version of the plugin with support for Android 14 and above, thanks to #89. The gist of it is, that from Android 14 (API level 34) upwards, you have to define the foreground service type(s) that you need for your app specifically. Therefore, it makes sense to move the declaration of these service types into the application using the plugin. Please refer to the new README and the Android documentation for further information.

I'll close this issue for now. If you are still having trouble, please don't hesitate to re-open it.