Why would adding FileProvider Path option in the manifest.xml file cause OPEN button in the Appinfo window disappear?

PressRex profile image
by PressRex
Why would adding FileProvider Path option in the manifest.xml file cause OPEN button in the Appinfo window disappear?

Android 12 API 31

I've been writing an Android App and one step at a time building it to my spec. Now, I am running into an issue.

One of the feature my app will have is emailing an image with a click of a button. So, I had to setup FileProvider to hide the DIRECT image file PATH before sending it out. One of the step in doing this is to include this FileProvider info in my manifest.xml as shown below.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
package="com.example.MyApp" >

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CALL_PHONE" />

<dist:module dist:instant="true" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/Theme.MyApp"
    android:usesCleartextTraffic="true" >
    <activity
        android:name=".MainActivity"
        android:exported="true" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <action android:name="android.intent.action.SEND" />
            <action android:name="android.intent.action.SENDTO" />

            <data android:scheme="mailto" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <provider
        android:name="androidx.core.content.FileProvider"
        android:authorities="${applicationId}.provider"
        android:exported="false"
        android:grantUriPermissions="true" >
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/provider_paths" />
    </provider>
</application>

However, I noticed right after doing so and running/installing/debugging successfully that my app acted unlike before;

My app ICON is not found within "Apps Icon" screen.

Under App Info window for my app, open button is missing as shown below with FileProvider code.

If I remove the FileProvider option from manifest.xml, Open button along with uninstall and force stop is displayed and active as shown below.

Otherwise, my app installs and runs with no issues, but the only time I have access is when it runs and the main activity is displayed automatically. If I close it, I have no way of starting it again, unless I rerun my code from Android Studio. So, what is the reason for this in regards to FileProvider?

Source: View source

PressRex profile image
by PressRex

Subscribe to New Posts

Lorem ultrices malesuada sapien amet pulvinar quis. Feugiat etiam ullamcorper pharetra vitae nibh enim vel.

Success! Now Check Your Email

To complete Subscribe, click the confirmation link in your inbox. If it doesn’t arrive within 3 minutes, check your spam folder.

Ok, Thanks

Read More