781flyingdutchman / background_downloader

Flutter plugin for file downloads and uploads
Other
165 stars 76 forks source link

[Android] Gradle MergeFailureException with compileSdkVersion 34 and Foreground Service #333

Closed Nico04 closed 5 months ago

Nico04 commented 5 months ago

After adding configuration for the Android Foreground Service in AndroidManifest.xml (copied from this package doc), I can't compile anymore, it throw a MergeFailureException.

After a small research, solution was to remove tools:node="merge" part of the config

Before

<service
  android:name="androidx.work.impl.foreground.SystemForegroundService"
  android:foregroundServiceType="dataSync"
  tools:node="merge" />

After

  <service
      android:name="androidx.work.impl.foreground.SystemForegroundService"
      android:foregroundServiceType="dataSync" />

Maybe you could update the documentation ? Or I missed someting ?

Environment compileSdkVersion 34 Flutter 3.22.2

781flyingdutchman commented 5 months ago

Can you share the text of the MergeFailureException?

Nico04 commented 5 months ago

It won't help you ^^

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> com.android.manifmerger.ManifestMerger2$MergeFailureException: Error parsing ***\android\app\src\main\AndroidManifest.xml
781flyingdutchman commented 5 months ago

Thanks - I see that the example app also does not have the 'merge' line, so I guess it shouldn't be there and I'll remove it in the next version. Thanks!