How to fix auth/missing-android-pkg-name: Android Package Name required in Firebase
This error occurs when using Firebase Authentication's ActionCodeSettings with Android-specific options like installIfNotAvailable or minimumVersion without providing the required androidPackageName parameter.
Quick fix
Fixes auth/missing-android-pkg-name: Android Package Name required
ActionCodeSettings actionCodeSettings = ActionCodeSettings.newBuilder()
.setUrl("https://www.example.com/finishSignUp")
.setHandleCodeInApp(true)
.setAndroidPackageName(
"com.example.android", // Your Android package name
true, // installIfNotAvailable
"12" // minimumVersion (optional)
)
.build();
FirebaseAuth.getInstance()
.sendSignInLinkToEmail(email, actionCodeSettings);- Add androidPackageName to ActionCodeSettings
- Verify package name matches your Android app
- Remove Android settings if not needed
- Test with a complete ActionCodeSettings configuration
ActionCodeSettings actionCodeSettings = ActionCodeSettings.newBuilder().setUrl("https://www.example.com/finishSignUp").setHandleCodeInApp(true).setAndroidPackageName("com.example.android", // Your Android package nametrue, // installIfNotAvailable"12" // minimumVersion (optional)).build();FirebaseAuth.getInstance().sendSignInLinkToEmail(email, actionCodeSettings);auth/missing-android-pkg-name: Android Package Name required
What this error means
The `auth/missing-android-pkg-name` error is thrown by Firebase Authentication when you attempt to configure ActionCodeSettings with Android-specific parameters but fail to provide the Android package name. This typically happens when sending email verification links, password reset emails, or email sign-in links that need to be handled by your Android app. Firebase's ActionCodeSettings allows you to customize how email action links behave across different platforms. When you specify Android-specific settings like `installIfNotAvailable` (to install the app from Google Play if not present) or `minimumVersion` (to enforce a minimum app version), Firebase requires the `androidPackageName` to know which app should handle the link. Without this package name, Firebase cannot route the user to the correct Android application. This validation ensures that email links are properly configured before being sent to users, preventing broken authentication flows where users click a link but the system doesn't know which app to open.
Typical symptoms
- Error thrown when calling sendSignInLinkToEmail() with Android settings
- Email verification or password reset fails during ActionCodeSettings configuration
- Error appears in Firebase Authentication methods that use email links
- Authentication flow breaks when Android-specific options are specified
Common causes
- Setting installIfNotAvailable or minimumVersion in ActionCodeSettings without providing androidPackageName
- Using setAndroidPackageName() with only installIfNotAvailable parameter but missing the package name string
- Configuring ActionCodeSettings.android object with installApp or minimumVersion but no packageName property
- Attempting to enable Android app installation from email links without specifying which app to install
How to fix "auth/missing-android-pkg-name: Android Package Name required"
When using Android-specific settings in ActionCodeSettings, always provide the package name as the first parameter.
For Android/Java:
ActionCodeSettings actionCodeSettings = ActionCodeSettings.newBuilder()
.setUrl("https://www.example.com/finishSignUp")
.setHandleCodeInApp(true)
.setAndroidPackageName(
"com.example.android", // Your Android package name
true, // installIfNotAvailable
"12" // minimumVersion (optional)
)
.build();
FirebaseAuth.getInstance()
.sendSignInLinkToEmail(email, actionCodeSettings);For Web/JavaScript:
const actionCodeSettings = {
url: 'https://www.example.com/finishSignUp',
handleCodeInApp: true,
android: {
packageName: 'com.example.android',
installApp: true,
minimumVersion: '12'
}
};
await auth.sendSignInLinkToEmail(email, actionCodeSettings);For Flutter:
final actionCodeSettings = ActionCodeSettings(
url: 'https://www.example.com/finishSignUp',
handleCodeInApp: true,
androidPackageName: 'com.example.android',
androidInstallApp: true,
androidMinimumVersion: '12',
);
await FirebaseAuth.instance.sendSignInLinkToEmail(
email: email,
actionCodeSettings: actionCodeSettings,
);Ensure the package name you provide matches exactly what's configured in your Android app and Firebase console.
Check your Android app's package name:
1. Open android/app/build.gradle
2. Find the applicationId in the defaultConfig block:
android {
defaultConfig {
applicationId "com.example.android" // This is your package name
// ...
}
}Verify in Firebase Console:
1. Go to Firebase Console → Project Settings
2. Scroll to "Your apps" section
3. Select your Android app
4. Confirm the package name matches exactly (case-sensitive)
If the package names don't match, either update your ActionCodeSettings to use the correct package name, or reconfigure your Firebase project with the correct package name.
If you don't actually need Android-specific behavior (like app installation or version enforcement), simply omit those parameters:
Minimal configuration (no Android-specific settings):
ActionCodeSettings actionCodeSettings = ActionCodeSettings.newBuilder()
.setUrl("https://www.example.com/finishSignUp")
.setHandleCodeInApp(true)
.build();This configuration will still work on Android devices but won't attempt to install the app or enforce version requirements. The email link will simply open in the user's browser or app if already installed.
Only include androidPackageName and related settings if you specifically need:
- Automatic app installation from Google Play
- Minimum version enforcement
- Direct deep linking to your Android app
Create a fully configured ActionCodeSettings object with all required fields for your use case:
ActionCodeSettings actionCodeSettings = ActionCodeSettings.newBuilder()
// Required: URL where the link should redirect
.setUrl("https://www.example.com/finishSignUp?email=" + email)
// Required for email link authentication
.setHandleCodeInApp(true)
// Android configuration (all three parameters)
.setAndroidPackageName(
"com.example.android", // Package name (REQUIRED if using Android settings)
true, // Install if not available
"12" // Minimum version
)
// iOS configuration (optional)
.setIOSBundleId("com.example.ios")
// Optional: Additional state/context
.setDynamicLinkDomain("example.page.link")
.build();
try {
FirebaseAuth.getInstance()
.sendSignInLinkToEmail(email, actionCodeSettings)
.addOnCompleteListener(task -> {
if (task.isSuccessful()) {
Log.d("Auth", "Email link sent successfully");
}
});
} catch (Exception e) {
Log.e("Auth", "Failed to send email link: " + e.getMessage());
}Ensure you've added the necessary Firebase configuration files (google-services.json) to your Android project.
Advanced notes
Dynamic Links Deprecation:
Firebase Dynamic Links, which were previously used for email link authentication, are being deprecated on August 25, 2025. If you're building new features with email links, consider migrating to the Firebase Hosting-based solution for handling authentication links. The androidPackageName requirement remains the same in both approaches.
Package Name Security:
The package name serves as a security identifier in Firebase. Each combination of package name and SHA-1 certificate fingerprint must be unique across all Firebase and Google Cloud projects. This prevents unauthorized apps from intercepting authentication links meant for your app.
Testing Email Links:
When testing email link authentication in development, you can use Android emulators or physical devices. The package name must match your debug or release build configuration. For debug builds, you may need to add the debug SHA-1 fingerprint to your Firebase project settings.
Cross-Platform Considerations:
If your app supports both Android and iOS, configure both platforms in ActionCodeSettings. The system will automatically detect the user's platform and route them appropriately:
.setAndroidPackageName("com.example.android", true, "12")
.setIOSBundleId("com.example.ios")React Native & Flutter:
These frameworks abstract the native configuration but still require the package name to be specified. Ensure your platform-specific configuration files (android/app/build.gradle for Android) have the correct applicationId that matches what you provide to ActionCodeSettings.
Frequently asked questions
- What does "auth/missing-android-pkg-name: Android Package Name required" mean?
- The auth/missing-android-pkg-name error is thrown by Firebase Authentication when you attempt to configure ActionCodeSettings with Android-specific parameters but fail to provide the Android package name. This typically happens when sending email verification links, password reset emails, or email sign-in links that need to be handled by your Android app. Firebase's ActionCodeSettings allows you to customize how email action links behave across different platforms.
- How do I fix "auth/missing-android-pkg-name: Android Package Name required"?
- This error occurs when using Firebase Authentication's ActionCodeSettings with Android-specific options like installIfNotAvailable or minimumVersion without providing the required androidPackageName parameter.
- What causes "auth/missing-android-pkg-name: Android Package Name required"?
- Setting installIfNotAvailable or minimumVersion in ActionCodeSettings without providing androidPackageName Using setAndroidPackageName() with only installIfNotAvailable parameter but missing the package name string Configuring ActionCodeSettings.android object with installApp or minimumVersion but no packageName property
- Is the "auth/missing-android-pkg-name: Android Package Name required" error serious?
- It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- 📚Firebase Official Documentation
- 📖firebase.google.com - email link auth(Official Docs)
- 📖firebase.google.com - ActionCodeSettings(Official Docs)
- 🐙
- 🔗
- 📖firebase.google.com - email link migration(Official Docs)