jjordanoc / azure_speech_recognition_null_safety

A Flutter plugin that enables interaction with the Azure Cognitive Services Speech-To-Text API
GNU General Public License v3.0
11 stars 13 forks source link

[CRITICAL] "Namespace is not specified" build exception with Android Studio Ladybug 2024.2.1 for Android #19

Open KillianFvt opened 1 week ago

KillianFvt commented 1 week ago

Hello! I recently upgraded Android Studio to Ladybug version, which comes with a new Java version (21 instead of 17 previously). Since this update, I can't compile any of my project on Android using the [azure_speech_recognition_null_safety] package, since it's not compatible with the newest java version.

This is my stacktrace :


* What went wrong:
A problem occurred configuring project ':azure_speech_recognition_null_safety'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
   > Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

     If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

* 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 1s
Error: Gradle task assembleDebug failed with exit code 1

I'm using the latest version of the package (0.9.5). Flutter 3.22.0 Dart 3.4.0 Gradle 8.3.0

What can I do?

PS: This issue will surely be reported more in the future, as more people are going to update their Android Studio and Java version.

Macht59 commented 1 week ago

You may open android folder in Android Studio and perform auto update procedure - Android Studio should ask you to do so.

KillianFvt commented 1 week ago

I did, and it worked for my app. However the AGP Upgrade Assistant does not update packages, as they are read-only files. I might make a fork and perform the upgrade on the package itself.