Android install error: the package conflicts with an existing package of the same name
The package conflicts with an existing package by the same nameShort answer
Android allows only one app per application ID, and an update must be signed with the same certificate as the installed version. The conflict means the installed app was signed with another key, or a second app uses the same ID. Uninstall the old copy, sign with the same key, or give each variant its own ID.
Fix it fast
1Find out which cause you have
Check whether the application ID is already on the device, and which one it is.
adb shell pm list packages | grep com.example.myapp2Match what you see, then jump to its fix
- 1
The same app installed from a store or another machine, now replaced by a debug or release build from your computerThe installed copy was signed with a different keyFix - 2
You need a debug and a release, or two flavors, on the same deviceTwo variants of the app share one application IDFix - 3
The template id com.example.something is left in more than one projectA different project reuses the same applicationIdFix
- 1
What does the error look like?
The package conflicts with an existing package by the same name
Cause 1 of 3
The installed copy was signed with a different key
1Check
Android compares the certificates when it installs an update. A debug build and a release build are signed differently, so they cannot replace each other.
cd android && ./gradlew signingReport2Fix
Remove the installed copy, then install yours. This deletes the app's local data. For a real update, sign with the same key as the installed version.
adb uninstall com.example.myapp
flutter run3Verify
The install completes.
adb shell pm list packages | grep com.example.myappConfirmed by developer.android.com
Cause 2 of 3
Two variants of the app share one application ID
1Check
No two apps on a device can have the same application ID. Look at what each build type or flavor sets.
grep -n "applicationId\|applicationIdSuffix" android/app/build.gradle*2Fix
Add an applicationIdSuffix to the build type or flavor that must live beside the other.
android {
buildTypes {
debug {
applicationIdSuffix = ".debug"
}
}
}3Verify
Install both builds; they appear as separate apps.
adb shell pm list packages | grep com.example.myappConfirmed by developer.android.com
Cause 3 of 3
A different project reuses the same applicationId
1Check
Read the applicationId of the project you are installing and compare it with the one on the device.
grep -n "applicationId" android/app/build.gradle*2Fix
Set an explicit, unique applicationId. Keep it fixed once published, because changing it makes the store treat the app as a new one.
android {
defaultConfig {
applicationId = "com.yourcompany.yourapp"
}
}3Verify
Build and install; the ID in the package list matches.
flutter runConfirmed by developer.android.com
How do I stop it coming back?
- Give debug builds their own suffix so a local build never fights with an installed release.
- Keep one signing key per app and back it up; the key cannot change during the app's life.
- Replace the template application ID before the first install.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
Related fixes
Mobile apps
Google Play says the app does not support 16 KB memory pages
check_elf_alignment.sh reports UNALIGNED for a library under lib/arm64-v8a
Google Play requires apps that target Android 15 or higher and ship native .so libraries to run on devices with 16 KB memory pages; from 1 February 2027 it will block updates that do not.
5 causes, each with a fixMobile apps
Gradle cannot find com.google.firebase:firebase-analytics-ktx
Required by: project :app
Firebase moved the Kotlin extensions into the main modules and stopped releasing the -ktx modules in July 2025.
2 causes, each with a fixMobile apps
Gradle cannot create LibraryVariantBuilderImpl in a Flutter Android build
Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl
This error appears when the Android Gradle plugin (AGP) cannot run in the Gradle or IDE you use.
3 causes, each with a fixMobile apps
Flutter release build cannot open the keystore: HmacPBESHA256 not available
Algorithm HmacPBESHA256 not available
The keystore is a PKCS12 file protected by a newer algorithm than the Java that is reading it understands.
3 causes, each with a fixMobile apps
Android resource linking fails with resource android:attr/lStar not found
error: failed linking references.
The lStar attribute exists only from Android API 31.
2 causes, each with a fixMobile apps
Gradle cannot find the Android SDK on this machine
FAILURE: Build failed with an exception. What went wrong: SDK location not found.
Gradle looks for the Android SDK in the sdk.dir line of android/local.properties and in the ANDROID_HOME environment variable, and found neither.
4 causes, each with a fix