I'm trying to migrate my ionic app from cordova to capacitor.
But I'm getting an error in Android build.
android\capacitor-cordova-android-plugins\src\main\java\nl\xservices\plugins\FileProvider.java:4: error: package android.support.v4.content does not exist
public class FileProvider extends android.support.v4.content.FileProvider {
Does anyone knows how to solve this problem?
I was having the same issue, and I fixed it in these foollowing steps:
Go to the FileProvider file where the issue is happening, you can click the path that Android Studio gives you.
Instead of "public class FileProvider extends android.support.v4.content.FileProvider" replace it with "public class FileProvider extends androidx.core.content.FileProvider".
This should fix the issue, hope this helps buddy.
PS. This error does not appear when starting the a project with Capacitor, hopefully they fix these kind of errors with Capacitor 2.0
try npx cap sync
command after adding any plugins. That works for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With