Android Studio debug/android manifest doesn't change & giving error - android

I worked on a android project all day today. Now I am trying to load a project into android studio. It gives me error on > debug/android manifest
even though I corrected the error . It keeps repeating the same error on same place. It looks like coding doesn't change
Error:(45) Tag attribute authorities has invalid character '#'.
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider#string/facebook_app_id"
android:exported="true" />
It automatically inserted between permissions on debug/android manifest. original manifest file has no error nor any unnecessary coding between permissions

In Android Studio, try File -> Invalidate Cache and Restart.
I'd similar problem where changes in res/AndroidManifest.xml were not being reflected in debug\AndroidManifest.xml and above step did the trick for me.

Did you checked sample project on facebook-android-sdk repo?
https://github.com/facebook/facebook-android-sdk/blob/master/samples/RPSSample/AndroidManifest.xml
Here
<provider android:authorities="com.facebook.app.FacebookContentProvider157578437735213"
android:name="com.facebook.FacebookContentProvider"
android:exported="true" />
app_id is entered as hard-coded instead of string parameter. You can try this or ensure that you have "facebook_app_id" parameters in strings.xml.

It's failing because you're accessing an #string reference in the middle of the value of the authorities attribute, and references need to appear by themselves to be interpreted correctly. There are a couple approaches around this.
First, you can hardcode the facebook app id by appending it to the end of FacebookContentProvider like so (assume 22222222 is the facebook app id):
<provider android:authorities="com.facebook.app.FacebookContentProvider22222222"
android:name="com.facebook.FacebookContentProvider"
android:exported="true" />
But this is not ideal if you have different facebook app ids (for example, one for development, one for staging, and one for production). To set the authorities attribute dynamically, you first need to set the specific values in your build.gradle file:
...
buildTypes {
release {
resValue "string", "facebook_content_provider_app_id", "\"com.facebook.app.FacebookContentProvider55555555555\""
}
debug {
resValue "string", "facebook_content_provider_app_id", "\"com.facebook.app.FacebookContentProvider22222222222\""
}
}
Once you have that in place, you can reference the facebook app id regardless of the build type dynamically in the AndroidManifest.xml:
<provider android:authorities="#string/facebook_content_provider_app_id"
android:name="com.facebook.FacebookContentProvider"
android:exported="true" />

Related

Ionic - Android authorities: FacebookContentProvider undefined in android manifest

Can’t install because provider name com.facebook.app.FacebookContentProviderundefined (in package io.ionic.sxxxx) is already used by io.ionic.yyyyy]"
This is listed in a few android manifest files
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider"
android:exported="true" />
on build I get
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProviderundefined"
android:exported="true" />
— notice the undefined ----- should I be defining something somewhere? Is there another solution? Basically I have a pair of apps that will not install at the same time on a device because this output is the same. My understanding is undefined should be my facebook id. I do have a variety of values defined in my android strings file. I have seen a few answers from a couple years ago on here (Android Facebook content provider authority) , but the solutions do not work as the files in my android directory are different as are their contents. Any help would be much appreciated!
<string name="title_activity_main">xxxx</string>
<string name="package_name">io.ionic.xxxx</string>
<string name="custom_url_scheme">io.ionic.xxxx</string>
<string name="fb_app_id">xxxxx</string>
<string name="facebook_app_id">xxxxx</string>
<string name="fb_app_name">xxxxx</string>
<string name="fb_login_protocol_scheme">fbxxxxxx</string>
<string name="fb_auto_log_app_events_enabled">true</string>
<string name="fb_advertiser_id_collection_enabled">true</string>
I have tried deleting all of the tags from all of the android manifest files, but they are generated on build. I have tried adding a string called authority in my string.xml file. I have struggeled to figure out how to implement the solutions here, as they dont exactly align with the files in my ionic project. Android Facebook content provider authority.
There is an open issue about this on GitHub:
https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect/issues/100
Did you try the temporary solutions provided in the comments?
HCJSolutions commented on Dec 10, 2021
I found a temporary solution is add ${applicationId}
modified the platforms\android\app\src\main\AndroidManifest.xml find a
node 123456789"
android:exported="true"
android:name="com.facebook.FacebookContentProvider" />
or
change it at
plugin folder plugins\cordova-plugin-facebook-connect\plugin.xml find
the line <provider
android:authorities="com.facebook.app.FacebookContentProvider${applicationId}$APP_ID"
and
apren commented on Apr 24:
Another temporary solution:
Set any APP_ID, for example APP_ID = "app_package_name" After init app
use code
facebookConnectPlugin.setApplicationId('your_facebook_app_id')

Get application Id in XML dynamically

I'm using shortcuts in my application and I have multiple product flavors. I want to get the application Id dynamically for target package.
I've given ${applicationId}, but it's not working. I tried with ${packageName} didn't work. any other alternative?
<shortcut
android:enabled="true"
android:icon="#drawable/ic_barcode_icon"
android:shortcutId="bar_code"
android:shortcutShortLabel="#string/shortcuts_my_bar_code">
<intent
android:action="android.intent.action.VIEW.myBarCode"
android:targetClass="com.appemirates.clubapparel.home.HomeActivity"
android:targetPackage="${applicationId}" />
</shortcut>
Manifest placeholders like ${applicationId} are only supported for the manifest, not arbitrary other XML files, such as shortcut metadata resources.
You could try:
Have a copy of your shortcut XML in each product flavor's source set, where that copy has the hardcoded application ID
Use resValue in Gradle to set up a string resource with the application ID (per flavor), and use #string/... notation to refer to it in the shortcut XML
The first one definitely works but is tedious due to the code duplication. I have not tried the second one.
Otherwise, you would be looking at building your own Gradle plugin or similar processor that could dynamically generate these resources from a template.
you can create BuildConfig parameter through gradle.
You need to add below in specific build flavor
resValue "string", "APP_ID", "com.example.myapp.india"
that will generate string resource as per your build flavor.And you can directly use it as below in your code.
<shortcut
android:enabled="true"
android:icon="#drawable/ic_barcode_icon"
android:shortcutId="bar_code"
android:shortcutShortLabel="#string/shortcuts_my_bar_code">
<intent
android:action="android.intent.action.VIEW.myBarCode"
android:targetClass="com.appemirates.clubapparel.home.HomeActivity"
android:targetPackage="#string/APP_ID" />
</shortcut>
Let me know for more help :)
In your app's build.gradle.kts (Gradle Kotlin DSL) you could add:
android {
// your setup...
androidComponents {
onVariants { variant ->
variant.resValues.put(
variant.makeResValueKey("string", "app_id"),
ResValue(variant.applicationId.get())
}
}
}
Which will write a string into the resources with the name app_id and use the application ID of the variant. You will then be able to reference the string resource using #string/app_id inside your XML resource files. ${applicationId} unfortunately only works in Manifest files, as has been mentioned in the other answers.
This solution should also work with flavours and build types which augment the application ID by using applicationIdSuffix, and thus answers the comment from Get application Id in XML dynamically.

Facebook Unity SDK issues when building for Android

I am not being able to solve this build-time issue when building for Android.
Here's the error message:
AndroidManifest.xml:39: Tag <provider> attribute authorities has invalid character '$'.
I found, indeed, in the AndroidManifest.xml produced in the Temp/StagingArea folder the following lines:
<!--
The initialization ContentProvider will call FacebookSdk.sdkInitialize automatically
with the application context. This config is merged in with the host app's manifest,
but there can only be one provider with the same authority activated at any given
point; so if the end user has two or more different apps that use Facebook SDK, only the
first one will be able to use the provider. To work around this problem, we use the
following placeholder in the authority to identify each host application as if it was
a completely different provider.
-->
<provider android:authorities="${applicationId}.FacebookInitProvider" android:exported="false" android:name="com.facebook.internal.FacebookInitProvider" />
It looks like the applicationId substitution is not working, but I correctly place it in the Facebook Settings, as stated in the docs.
Tried it with Facebook SDK 7.10, 7.11 and 7.12 on Unity 2017.2 and 2018.1 in an empty project with just the Facebook SDK plugin installed.
Anyone out there have any idea on what is happening here?
Try replacing this with your app id, $ returns package name not appID.
<provider android:authorities="FacebookInitProvider{APP ID HERE}" android:exported="true" android:name="com.facebook.internal.FacebookInitProvider" />

android apk upload not working because name not valid

I have signed and zipalign my android application and now wishes to upload it on the play store.
I however get the following message when I am done uploading it:
Upload failed
Your APK's package name must be in the following format "com.example.myapp". It may contain letters (a-z), numbers, and underscores (_). It must start with a lowercase character. It must be 150 characters or fewer.
My apk name is
dd.afm.aftermath.apk
So I don't understand why it does not comply?
Thanks in advance
Change your AdnroidManifest.xml file's package value from "AndroClient.AndroClient" to "com.example.myapp" (or whatever).
Then Xamarin will use it when compiling.
The error message complains about the 'package name', not about the APK file name.
Your package name is set to 'AndroClient.AndroClient', which does not match the prescribed pattern of com.example.app. Change your package name to something like com.dualdub.androclient.
background
The package name and version code is what identifies an app. Increase the version code, while keeping the same package name, and people will get automatically updated to the new version. Change the package name and the Google Play Store considers it a different app.
As you probably know, there are now millions of published apps. To prevent package name clashes the prescribed way is to prefix your app's name with your website domain in reverse. In your profile it says that http://dualdub.com is your website. So you should prefix your app's name with "com.dualdub.". Package names are case-sensitive; it is common practice to use all lower case.
Google Play Store reads your package name from the AndroidManifest.xml, from the 'manifest' element; 'package' attribute. How to change that depends on your IDE.
Change package name with Android Studio
When you are using Android Studio you are also using the Gradle build system. The Gradle build system overrides the package name in the manifest for you. During the build it puts the applicationId in the manifest package attribute.
Open the build.gradle file in your app module. It should be located at: <projectDir>/app/build.gradle. It should look something like this:
app/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.0"
defaultConfig {
applicationId "com.example.appname"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
Update the applicationId to be com.dualdub.androclient.
Change package name with Eclipse
To be honest, I have never used Eclipse so I will have to give you vague directions.
In the AndroidManifest.xml you have the manifest package attribute. It plays a dual role: 1) it specifies the package name (also known as the applicationId), 2) it helps shorten class names that you specify with other elements, e.g. when specifying activities you can write android:name=".MainActivity" instead of android:name="com.example.appname.MainActivity".
To change the package name you will actually have to change the namespace of your code. In your .java files change the first line from 'package AndroClient.AanroClient;' to package com.dualdub.androclient;.
Most likely, Eclipse will have a refactoring tool to rename java packages to make this easier for you.
As the error says:
It must start with a lowercase character
While your package name is: AndroClient.AndroClient, which starts with an upper case letter.
Citing from the documentation:
Package Name is the package namespace for your app (following the same rules as packages in the Java programming language). Your package name must be unique across all packages installed on the Android system. For this reason, it's generally best if you use a name that begins with the reverse domain name of your organization or publisher entity. For this project, you can use something like "com.example.myfirstapp." However, you cannot publish your app on Google Play using the "com.example" namespace.
I'd suggest to just conform to the "reverse domain" rule of thumb
its the problem of your package..
Change your package name as remove example from it..
eg:
com.developer.name
The first line of your java source probably has the package name.
package com.gosylvester.hilbilyfashliegt;
The package name is also in the manifest.
The app name or what you call the app is setup in the manifest for android:label
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gosylvester.hilbilyfashliegt"
android:versionCode="7"
android:versionName="Juger" >
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name="com.gosylvester.hilbilyfashliegt.MainActivity"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat.Light.DarkActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Generally you would store the app name in the res/values/strings.xml below app_name is the app name.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Hil Bily FashLiegt</string>
<string name="action_settings">Make stays</string>
<string name="author" translatable="false">by cousin Dan</string>
<string name="new_this_version">""New this one. Stil Kant make wir catch stay on good. Toch screen to mak er on. Use make stays for duk tap wird"</string>
<string name="aboutcheckbox">Reckon not show this here agin</string>
<string name="shareText">I reckon this here hillbile fashliegt app is worth a jar of moonshine. https://play.google.com/store/apps/details?id=com.gosylvester.hilbilyfashliegt</string>
<string name="sharesubject">Android add free flashLight App by Dan Sylvester</string>
<string name="about_firstrun">com.gosylvester.hilbilyfashliegt.firstrunabout</string>
<string name="preferences">com.gosylvester.hilbilyfashliegt.prefrences</string>
</resources>

Install shows error in console: INSTALL FAILED CONFLICTING PROVIDER

I am experimenting with the NotesList sample program in the Android SDK. I've made a slight variation in the program, but when I install my edited version I keep getting the message INSTALL_FAILED_CONFLICTING_PROVIDER in the console when I try to install it when the original notes program is already on the device. What do I need to change in the Provider to make it a unique database? It works fine if I uninstall the original notes program and then install my edited version.
The authority, as listed in android:authorities must be unique. Quoting the documentation for this attribute:
To avoid conflicts, authority names should use a Java-style naming convention (such as com.example.provider.cartoonprovider). Typically, it's the name of the ContentProvider subclass that implements the provider
If you have different flavors and you want to avoid collisions in the authority name you can add an applicationIdSuffix to build types and use the resulting applicationId in your manifest, like this:
<...
android:authorities="${applicationId}.contentprovider"/>
This can also happen when you have an older version of your app installed and made changes to the (support) library or the manifest file. Deleting the old applications from your device (Settings --> Application --> <your application> --> Uninstall) will solve the issue then.
If you are using Google Maps + Google Play Services inside a library project (especially if you recently migrated from Eclipse to Android Studio), you can encounter this error when you try to run an app that uses your library, while a different app that uses the same library is already installed on your device.
Fix:
make sure that defaultConfig.applicationId is defined in android section of the build.gradle file for each project using your library
android {
defaultConfig.applicationId = "com.company.appname"
}
I would recommend using the package name of the specific app. With this fix, the provider names will no longer conflict, and your app will run as expected.
Symptoms
1.) Your users are seeing the dreaded "-505" install error when installing your app from the Play Store.
2.) You will see this error message when you try to install a second app that uses your library via Android Studio [INSTALL_FAILED_CONFLICTING_PROVIDER]:
In your console, you will see a message like this:
Package couldn't be installed in /data/app/com.company.appname-1
com.android.server.pm.PackageManagerException:
Can't install because provider name
com.google.android.gms.measurement.google_measurement_service
(in package com.company.appname) is already used by
com.company.otherInstalledAppName
The fix is to make sure that defaultConfig.applicationId is defined in android section of the build.gradle file for each project using your library
android {
defaultConfig.applicationId = "com.company.appname"
}
More reading can be found here in the original bug report: Issue 784: Multiple apps using same authority provider name
If you are using the Facebook SDK then the issue might be in the "authorities" value you provide for the Facebook provider.
REPLACE -
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.FacebookContentProvider"
android:exported="true" />
WITH ->
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.FacebookContentProvider[YOUR_APP_ID]"
android:exported="true" />
You might need to change the defaultConfig.ApplicationId also as suggested in other answers.
The same error may occur after renaming packages. Check the value in string.xml for android:authorities from AndroidManifest.xml.
<provider
android:authorities="#string/content_authority"
android:name=".data.Provider"
... />
In string.xml the value should be the same as your package name, declared in manifest.
<string name="content_authority">com.whatever.android.sunshine.app</string>
Basically this happened with me, when i tried to change the package name of the app.
So, in emulator, same app was installed before. When i tried to install app after changing package name, it said, authority already used by older application in device.
Simply after uninstalling the application, it solved my problem.
Also, Authority name should always be : your.package.name.UNIQUENAME;
example :
<provider
android:name="com.aviary.android.feather.cds.AviaryCdsProvider"
android:authorities="your.package.name.AviaryCdsProvider"
/>
I have tried many solution but could not find solution... but this link helped me... I want to give detail about issue...
I was running Instrumented test cases so my app was not visible in launcher... but it was installed and thus using Same Content Provider. So, I should uninstall it somehow. So Settings -> Application Manager -> All Downloaded Apps -> uninstall all apps from your current development package
Now, try to run... This will work...
The Authority + Provider name that you have declared in the manifest probably
I had a similar problem when I used one library in several applications. It was necessary just update your AndroidManifest.xml with this exact provider declaration below.
<manifest ...>
<application ...>
<provider android:name="android.support.v4.content.FileProvider" android:authorities="${applicationId}.here.this.library.provider" android:exported="false" android:grantUriPermissions="true" tools:replace="android:authorities">
</provider>
</application>
</manifest>
I thought uninstalling the app by dragging its icon to "Uninstall" would solve the problem, but it did not.
Here is what solved the problem:
Go to Settings
Choose Apps
Find your app (yes I was surprised to still find it here!) and press it
In the top-right, press the 3 dots
Select "Uninstall for all users"
Try again, it should work now.
Stating the obvious, but also make sure you have not silently messed up the reference to the applicationId in android:authorities.
In my case I made a typo and omitted the damn dollar sign :
android:authorities="{applicationId}.myprovider"
instead of :
android:authorities="${applicationId}.myprovider"
That did not cause any immediate error (since it is a valid authority name). But a couple days later, when I tried to install different variants of an application, it was a real pain to understand what was wrong, as the error message does not give much info about what is wrong with the content providers.
Another way to troubleshoot this is to compare your merged manifests, looking for identical authorities.
If you are using Facebook inside app check for provider tag inside AndroidManifest file and check your project Id is correct for android:authorities
<provider android:name="com.facebook.FacebookContentProvider" android:authorities="com.facebook.app.FacebookContentProvider112623702612345" android:exported="true" />
Encountered this issue.
Resolved it by:
1 - open AndroidManifest.xml
2 - ctrl+f find "provider"
3 - find provider and update your root directory name there.
run project. hopefully issue will be fixed!
If you are using the emulator, you may try the following. The below worked for me.
Go to Tools --> AVD Manager --> (Pick Your emulator) --> Wipe Data.
The error went away.
install using adb with command ./adb install -r abc.apk will solve the problem (it will overwrite even when the device has higher app version)
i had this problem :
Installation did not succeed.
The application could not be installed: INSTALL_FAILED_CONFLICTING_PROVIDER
but it was not from provider of manifest
the below library in my app has conflict with other app and the others can not be install:
implementation 'com.iceteck.silicompressorr:silicompressor:2.2.1'
I´ve got this error, when implementing an library with following AndroidmManifest.xml
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="library.path.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_paths"/>
</provider>
I solved this when i put following Code in Project AndroidManifest.xml (app/src/main):
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
</provider>
Yeah! I have the same problem as you。As you said,you use "variation". keep the "authorities" unique, you can write as this
android:authorities="${applicationId}.provider"
if you have a lib use in an app more than one,The same reason as above.
If you are on Xamarin and you get this error (probably because of Firebase.Crashlytics):
INSTALL_FAILED_CONFLICTING_PROVIDER
Package couldn't be installed in [...]
Can't install because provider name dollar_openBracket_applicationId_closeBracket (in package [...]]) is already used by [...]
As mentioned here, you need to update Xamarin.Build.Download:
Update the Xamarin.Build.Download Nuget Package to 0.4.12-preview3
On Mac, you may need to check Show pre-release packages in the Add Packages window
Close Visual Studio
Delete all cached locations of NuGet Packages:
On Windows, open Visual Studio but not the solution:
Tools -> Option -> Nuget Package Manager -> General -> Clear All Nuget Cache(s)
On Mac, wipe the following folders:
~/.local/share/NuGet
~/.nuget/packages
packages folder in solution
Delete bin/obj folders in solution
Load the Solution
Restore Nuget Packages for the Solution (should run automatically)
Rebuild
You can uninstall package name "com.example" from the device in which you run the app after than you run the app . This worked for me
It helped me: Go AndroidManifest and paste or replace with this code
<provider
android:authorities="${applicationId}.here.this.library.provider"
android:name="androidx.core.content.FileProvider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities" >
</provider>
if your are using provider check and do it by following method
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="androidx.multidex.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_path" />
</provider>
or use it
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.contentprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_path" />
</provider>
also if the applciation already exits in your mobile uninstall and then check
In my android device I had different flavors of the same app install. This gives me error INSTALL FAILED CONFLICTING PROVIDER.
so I uninstall my all flavors of the same app.
and tried
adb install -r /Users/demo-debug-92acfc5.apk
It solved my problem.
need to use android:name="androidx.core.content.contentprovider
or android:name="androidx.core.content.provider insteadof
android:name="androidx.core.content.fileprovider
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.contentprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/filepaths" />
</provider>
Solution 1
Run the app on a physical device instead of the emulator. I encountered this issue and my app didnt have a content provider defined.
Solution 2
In the other instance, i had an instrumented test app installed matching the same applicationId.
To fix the issue i had to run ./gradlew uA - uA short for uninstallAll task.
You can alternatively use the Gradle panel and choose navigate to app\install\uninstallAll task
If you using an emulator, you can wipe out the data
If you are using Audience Network Content Provider you need to add this code in your app AndroidManifest.xml
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider165632208074623"
android:exported="true" />
Your Facebook app id ---> 165632208074623
If you only need to use facebook for sign in to your app here is a tip:
(this fix worked in cordova project)
Step 1 and 2 must be completed to fix the problem.
1.
locate the file: platform/android/android.json
inside that file:
remove this code:
,{"xml": "<provider android:authorities=\"com.facebook.app.FacebookContentProvider<FACEBOOK_APP_ID>\" android:exported=\"true\" android:name=\"com.facebook.FacebookContentProvider\" />","count": 1
}
Then locate file: platforms/android/app/src/main/androidManifest.xml
remove this code:
<provider android:authorities="com.facebook.app.FacebookContentProvider<FACEBOOK_APP_ID>" android:exported="true" android:name="com.facebook.FacebookContentProvider" />
Now the application can run fine..
Im sorry if this answer is not relevant for the OP, but it may help many others that have this problem. I could not find this exact answer anywhere else.
I tried many solutions but couldn't find a solution:
I changed this in AndroidManifest
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.com.shareFile"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_paths" />
</provider>
Make the authorities changes as said by #Jose L Ugia.
(You can find the provider in the manifest(merge manifest))
Mostly it will be connected to an SDK that you implemented, So remove the SDK implementation line and sync the Gradle, and then again add the implement line and sync the Gradle.
The implementation line:
implementation files(<your SDK>)
Provider code: (you have to scroll down in merge-manifest to find it )

Categories

Resources