SECURITY WARNING: Never run commands you don't understand. Always review code before execution. Use at your own risk.
Mobile New Added 17 October 2026

Android: Namespace not specified. Specify a namespace in the module's build file

Android Gradle Plugin 8 stopped reading the package attribute from AndroidManifest.xml and requires namespace in build.gradle instead. Your own module is easy to fix; the harder case is an old third-party library or Flutter or React Native plugin that has not been updated, which fails the build even though your code is correct. The module named in the error tells you which one.

Quick fix

Read the commands before running them. Anything that restarts a service, deletes data or changes permissions should be tried on a non-production system first.

Quick fix
# Which AGP version is the project on?
grep -rn "com.android.tools.build:gradle\|id(\"com.android" build.gradle* settings.gradle* gradle/libs.versions.toml

# Move the package from the manifest into the module build file
grep -n "package=" app/src/main/AndroidManifest.xml
# android {
#     namespace = "com.example.myapp"
# }
# then delete package="..." from the manifest

# For an outdated plugin, upgrade it first
flutter pub outdated    # or: npm outdated

# AGP Upgrade Assistant does this for your own modules
# Android Studio: Tools > AGP Upgrade Assistant

How to diagnose Mobile errors

Mobile build errors are overwhelmingly toolchain and dependency version conflicts rather than code problems. Android builds fail on Gradle, JDK and Android Gradle Plugin version combinations; iOS builds fail on code signing, provisioning profiles and CocoaPods lockfile drift. The productive instinct is to check version compatibility matrices before reading stack traces.

If the quick fix above does not resolve it, work through these steps. They apply to this whole class of error, not just to this one message, which is usually what saves the time.

  1. Run the build with full output: ./gradlew assembleDebug --stacktrace --info. Gradle's default output hides the actual failing task.
  2. Verify the JDK the build is using (./gradlew -version), not the one on your PATH. Android Gradle Plugin has strict JDK requirements.
  3. For CocoaPods, run pod install, not pod update, after pulling changes, and open the .xcworkspace rather than the .xcodeproj.
  4. For code signing, check the provisioning profile's expiry, bundle identifier and device list in Xcode's Signing & Capabilities tab before touching certificates.
  5. Clear caches only as a last resort and one at a time (./gradlew clean, rm -rf ~/Library/Developer/Xcode/DerivedData, watchman watch-del-all), so you learn which one mattered.

Tools worth reaching for

  • ./gradlew --stacktrace --info
  • pod install
  • xcodebuild -showBuildSettings
  • flutter doctor -v
  • adb logcat

Authoritative references

Primary documentation for this error, worth reading before applying any fix in production.

developer.android.com developer.android.com

Related Mobile errors

See all 20 Mobile errors →

Browse other categories

Something missing or wrong?

This entry is maintained by hand. If the fix is out of date, incomplete, or you have a better one, email a correction and it will be reviewed.