google_ml_kit_flutter
google_ml_kit_flutter copied to clipboard
google_mlkit_smart_reply namespace in AndroidManifest.xml is no longer supported
When I upgrade the Gradle version to 8.2.1 (latest) and set the targetSdkVersion version and compileSdkVersion to 34 using Flutter 3.16.7 and Dart 3.2.4, I have a namespace error on google_mlkit_smart_reply package :
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Incorrect package="com.google_mlkit_smart_reply" found in source AndroidManifest.xml: /Users/quentinpayre/Documents/google_ml_kit_flutter/packages/google_mlkit_smart_reply/android/src/main/AndroidManifest.xml.
Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported.
Recommendation: remove package="com.google_mlkit_smart_reply" from the source AndroidManifest.xml: /Users/quentinpayre/Documents/google_ml_kit_flutter/packages/google_mlkit_smart_reply/android/src/main/AndroidManifest.xml.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':google_mlkit_smart_reply:processDebugManifest'.
> A failure occurred while executing com.android.build.gradle.tasks.ProcessLibraryManifest$ProcessLibWorkAction
> Incorrect package="com.google_mlkit_smart_reply" found in source AndroidManifest.xml: /Users/quentinpayre/Documents/google_ml_kit_flutter/packages/google_mlkit_smart_reply/android/src/main/AndroidManifest.xml.
Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported.
Recommendation: remove package="com.google_mlkit_smart_reply" from the source AndroidManifest.xml: /Users/quentinpayre/Documents/google_ml_kit_flutter/packages/google_mlkit_smart_reply/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.
> Get more help at https://help.gradle.org.
BUILD FAILED in 41s
Running Gradle task 'assembleDebug'... 41.8s
Exception: Gradle task assembleDebug failed with exit code 1
I reproduced the bug on your exemple too. Steps to reproduce the behavior:
- google_ml_kit_flutter/packages/example/android/app/build.gradle set
compileSdkVersion
andtargetSdkVersion
to 34 - You will also need to add this
namespace 'com.google_mlkit_example'
in android section in build.gradle - google_ml_kit_flutter/packages/example/android/build.gradle set
classpath 'com.android.tools.build:gradle:8.2.1'
in dependencies - google_ml_kit_flutter/packages/example/android/gradle/wrapper/gradle-wrapper.properties set
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
- See error
If I open my pub_cache and edit the google_mlkit_smart_reply/android/src/main/AndroidManifest.xml file removing the namespace package="com.google_mlkit_smart_reply"
it runs well locally.
Since I'm using Bitrise to Build my iOs and Android apps I have this issue on every android build.
In my project I use this version of google mlkit :
google_ml_kit: ^0.16.3
I tried to downgrade it but it didn't fix it
I don't know if I missed something but if someone found a solution please share it 🙂