It works perfectly. I can view pdf BUT now i can't install others flavors in my phone because of this error:
Installation did not succeed. The application could not be installed: INSTALL_FAILED_CONFLICTING_PROVIDER Installation failed due to: 'null' Retry
Code for referecnce :
App level build.gradle file
defaultConfig {
applicationId "com.abc.xyz"
minSdkVersion 21
targetSdkVersion 29
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"}
flavorDimensions "version"
productFlavors {
appdev {
dimension "version"
applicationIdSuffix ".dev"
versionCode buildVersionCodeDev()
versionName version_dev
}
appqa {
dimension "version"
applicationIdSuffix ".qa"
versionCode buildVersionCodeQA()
versionName version_qa
}
apppro {
dimension "version"
applicationIdSuffix ".pro"
versionCode buildVersionCodePro()
versionName version_pro
}
}
AndroidManifest.xml
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.freshdesk.helpdesk.provider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
Note:-
I follow this link but still facing the same issue can't install another falvour in same device even i remove provider tag from AndroidManifest.xml but getting same error.
Your file provider authority must depend on the package name. Right now, it is not dynamic and is the same for all your flavors. You can't have multiple apps with file providers that have the same
authorities
value. Make this value depends on theapplicationId
like this:See the documentation for reference: