I am trying to upgrade a working old app to support Android API 26, and one of the thing I need to use is android.support.v4.content.FileProvider - but it was not found.
I replaced it with the newer version, which is : androidx.core.content.FileProvider
This worked for me.
add compile 'com.android.support:support-v4:26.1.0'
to build.gradle file in app module.
Change to
public class FileProvider extends androidx.core.content.FileProvider {
}
Using the following commands solved my issue:
npm install jetifier --save
npx jetify
npx cap sync
for androidx
<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>
Instead of
import android.support.v4.content.FileProvider;
Try importing
import androidx.core.content.FileProvider;