The Situation
You hit the run button in Android Studio โ or fire off adb install โ and the device throws this back at you:
Installation did not succeed.
The application could not be installed: INSTALL_FAILED_CONFLICTING_PROVIDER
No stack trace. No pointer to what's conflicting. The install just dies.
What's happening: another installed app has already claimed the same ContentProvider authority string. Android treats provider authorities like unique IDs โ globally, across every app on the device. Two apps cannot share one. The system rejects the duplicate outright.
Root Cause Analysis
Open AndroidManifest.xml and find any <provider> tag:
<!-- Common culprit: FileProvider with hardcoded authority -->
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.example.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
...
</provider>
See that hardcoded authority string? That's the problem. Every build variant โ debug, release, every flavor โ ends up declaring the exact same authority. Install your debug build on a device that already has the release build installed, and Android blocks it immediately.
Third-party libraries are the other common culprit. A library that ships its own ContentProvider with a hardcoded authority will conflict across every app in your portfolio that includes it. Only one can live on the device at a time.
Find the Conflicting Authority
Check what the currently installed app has registered:
adb shell dumpsys package | grep -A2 "com.example"
Or inspect the merged manifest from your last build:
# After ./gradlew assembleDebug
cat app/build/intermediates/merged_manifests/debug/AndroidManifest.xml | grep -A5 "provider"
Quick Fix โ Uninstall the Conflicting App
Need to get the app running right now? Uninstall whatever's blocking it:
# Remove the app holding the conflicting authority
adb uninstall com.your.package.name
# Then install the new APK
adb install app-debug.apk
From Android Studio, go to the device's app settings, uninstall manually, then re-run. It works. But it's a band-aid โ the moment you reinstall either version, you're back to square one.
Permanent Fix โ Make the Authority Unique
Option 1: Use applicationId (Recommended)
Swap the hardcoded string for ${applicationId}:
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
Because every app has a unique package name, conflicts become impossible. Your debug build gets com.example.app.debug.fileprovider. Release gets com.example.app.fileprovider. No overlap, ever.
Update your Java/Kotlin code to match:
// Before โ hardcoded, breaks across build variants
Uri fileUri = FileProvider.getUriForFile(
context,
"com.example.fileprovider",
file
);
// After โ dynamic, always correct
Uri fileUri = FileProvider.getUriForFile(
context,
context.getPackageName() + ".fileprovider",
file
);
Option 2: Override a Library's Hardcoded Authority
Can't touch the library's source? Override it in your manifest with tools:replace:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application>
<provider
android:name="com.thirdparty.library.SomeProvider"
android:authorities="${applicationId}.someprovider"
android:exported="false"
tools:replace="android:authorities" />
</application>
</manifest>
The tools:replace="android:authorities" attribute tells the manifest merger to use your value, discarding whatever the library ships. Works well for any read-only dependency with a baked-in authority string.
Option 3: applicationIdSuffix for Multiple Variants
Running QA, staging, and production builds side by side on the same device? Give each a distinct package name at the Gradle level:
// build.gradle (app)
android {
buildTypes {
debug {
applicationIdSuffix ".debug" // โ com.example.app.debug
}
staging {
applicationIdSuffix ".staging" // โ com.example.app.staging
}
release {
// no suffix โ com.example.app
}
}
}
Pair this with the ${applicationId} authority in the manifest. Each variant gets a fully unique authority, automatically, with zero extra work.
Verify the Fix
Before installing, check the merged manifest to confirm the authority resolved correctly:
./gradlew processDebugManifest
grep -n "authorities" app/build/intermediates/merged_manifests/debug/AndroidManifest.xml
You want to see the full package name baked in:
android:authorities="com.example.app.debug.fileprovider"
Then install and watch for the success message:
adb install -r app/build/outputs/apk/debug/app-debug.apk
# Performing Streamed Install
# Success
Double-check on the device itself:
adb shell dumpsys package com.example.app.debug | grep -A3 "Provider"
If You're Still Stuck
Sometimes the conflicting app isn't obvious โ a system app or a separate project in your portfolio could be holding the same authority. Dump every provider registered on the device and search by keyword:
adb shell dumpsys package providers | grep "fileprovider"
That output tells you exactly which package owns it. Uninstall that package, apply the permanent fix, and you're clear.

