flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

🐛 [cloud_firestore] Gradle 8 incorrect package error

Open g-apparence opened this issue 1 year ago • 10 comments

Bug report

Describe the bug

  • upgrading the latest version of firebase auth forced me to also upgrade to Gradle 8. But now it requires to use namespace inside the build.gradle and not in manifest. So all firebase flutter plugin has to change this simultaneously.

Steps to reproduce

Steps to reproduce the behavior:

  1. Upgrade firebase flutter auth plugin to latest version
  2. run your app with firestore plugin on android
  3. See error or incorrect behavior
Execution failed for task ':cloud_firestore:processDebugManifest'.
> A failure occurred while executing com.android.build.gradle.tasks.ProcessLibraryManifest$ProcessLibWorkAction
   > Incorrect package="io.flutter.plugins.firebase.firestore" found in source AndroidManifest.xml: /Users/mcfly/.pub-cache/hosted/pub.dev/cloud_firestore-4.14.0/android/src/main/AndroidManifest.xml.
     Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported.
     Recommendation: remove package="io.flutter.plugins.firebase.firestore" from the source AndroidManifest.xml: /Users/mcfly/.pub-cache/hosted/pub.dev/cloud_firestore-4.14.0/android/src/main/AndroidManifest.xml.

Expected behavior

App builds and launch

g-apparence avatar Jan 05 '24 13:01 g-apparence

Thanks for the report @g-apparence I tried by upgrading firebase_auth and cloud_firestore versions to the latest and ran the firestore plugin example on Android which compiled properly. In the plugin example, I see that all plugins now support AGP 8.0 and has below addition:

Screenshot 2024-01-08 at 5 56 49 PM

Also see https://github.com/firebase/flutterfire/pull/11699

darshankawar avatar Jan 08 '24 12:01 darshankawar

Hi thank you for investing this. I'm still having this

6: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':cloud_firestore:processDebugManifest'.
> A failure occurred while executing com.android.build.gradle.tasks.ProcessLibraryManifest$ProcessLibWorkAction
   > Incorrect package="io.flutter.plugins.firebase.firestore" found in source AndroidManifest.xml: /Users/mcfly/.pub-cache/hosted/pub.dev/cloud_firestore-4.14.0/android/src/main/AndroidManifest.xml.
     Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported.
     Recommendation: remove package="io.flutter.plugins.firebase.firestore" from the source AndroidManifest.xml: /Users/mcfly/.pub-cache/hosted/pub.dev/cloud_firestore-4.14.0/android/src/main/AndroidManifest.xml.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

With

cloud_firestore: ^4.14.0

and gradle

classpath 'com.android.tools.build:gradle:8.1.1'

It seems that the namespace error is still present.

g-apparence avatar Jan 10 '24 13:01 g-apparence

Thanks for the update. I tried using the plugin example but didn't get the reported error, but based on the report and namespace error, I'll keep the issue open for team's input and tracking.

darshankawar avatar Jan 12 '24 11:01 darshankawar

Yes don't hesitate to ask more infos if you need. It happened since a month.

g-apparence avatar Jan 12 '24 13:01 g-apparence

Hi, i am also facing this issue after updating my firestore package

` Execution failed for task ':cloud_firestore:processDebugManifest'. [ ] > A failure occurred while executing com.android.build.gradle.tasks.ProcessLibraryManifest$ProcessLibWorkAction [ ] > Incorrect package="io.flutter.plugins.firebase.firestore" found in source AndroidManifest.xml: C:\Users\ampon\AppData\Local\Pub\Cache\hosted\pub.dev\cloud_firestore-4.14.0\android\src\main\AndroidManifest.xml. [ ] Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported. [ ] Recommendation: remove package="io.flutter.plugins.firebase.firestore" from the source AndroidManifest.xml: C:\Users\ampon\AppData\Local\Pub\Cache\hosted\pub.dev\cloud_firestore-4.14.0\android\src\main\AndroidManifest.xml.

Caused by: java.lang.RuntimeException: Incorrect package="io.flutter.plugins.firebase.firestore" found in source AndroidManifest.xml: C:\Users\ampon\AppData\Local\Pub\Cache\hosted\pub.dev\cloud_firestore-4.14.0\android\src\main\AndroidManifest.xml. [ ] Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported. [ ] Recommendation: remove package="io.flutter.plugins.firebase.firestore" from the source AndroidManifest.xml: C:\Users\ampon\AppData\Local\Pub\Cache\hosted\pub.dev\cloud_firestore-4.14.0\android\src\main\AndroidManifest.xml.

` Waiting for it to fixed so that i can successfully run my app

Oppong avatar Jan 13 '24 03:01 Oppong

Hello @g-apparence, could you provide a repo that can be easily cloned to see in which configuration this happens? Our gradle config should allow for both AGP versions.

Lyokone avatar Jan 23 '24 13:01 Lyokone

Hey @g-apparence. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Feb 01 '24 02:02 google-oss-bot

@Lyokone can i share the repository with you so that you can check what the problem actually is

Oppong avatar Feb 02 '24 05:02 Oppong

Hey @g-apparence. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Feb 13 '24 02:02 google-oss-bot

Hi @g-apparence, were you able to figure out what the problem was?

JimmyRamokgopa avatar Feb 17 '24 08:02 JimmyRamokgopa

Hey @g-apparence. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Feb 27 '24 02:02 google-oss-bot

Since there haven't been any recent updates here, I am going to close this issue.

@g-apparence if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

google-oss-bot avatar Mar 06 '24 02:03 google-oss-bot