A problem occurred configuring project ':agora_rtm'.
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: C:\Users\Admin\AppData\Local\Pub\Cache\hosted\pub.dev\agora_rtm-1.5.9\android\build.gradle. See 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 for general information.
Checked build.gradle (Module-level) – I couldn't find a namespace declaration inside android {}. Reviewed AndroidManifest.xml – The package attribute is correctly defined. Tried updating dependencies – No luck after running flutter pub upgrade and flutter clean. AGP Version – I'm using the latest Android Gradle Plugin (AGP) version that supports namespace enforcement.
A problem occurred configuring project ':agora_rtm'.
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: C:\Users\Admin\AppData\Local\Pub\Cache\hosted\pub.dev\agora_rtm-1.5.9\android\build.gradle. 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.
Checked build.gradle (Module-level) – I couldn't find a namespace declaration inside android {}. Reviewed AndroidManifest.xml – The package attribute is correctly defined. Tried updating dependencies – No luck after running flutter pub upgrade and flutter clean. AGP Version – I'm using the latest Android Gradle Plugin (AGP) version that supports namespace enforcement.
Share Improve this question asked Feb 5 at 19:34 Deepak sutharDeepak suthar 11 bronze badge1 Answer
Reset to default 0This issue occurs because the agora-rtm package does not specify a namespace in its build.gradle file, which is required in newer versions of the Android Gradle Plugin (AGP). You can:
Wait for the package to update
Fix the issue manually
To fix this manually, you need to modify the package locally:
Navigate to the Flutter publish cache directory where agora-rtm is installed:
Open build.gradle inside the android folder of the package.
Inside the android {} block, add the namespace property:
android {
namespace "your.package.name"
}
Replace "your.package.name" with the package name defined in AndroidManifest.xml.