rch
rch

Reputation: 31

error: package android.support.v4.content does not exist import android.support.v4.content.FileProvider;

I'm trying to open the email box using cordova-plugin-email-composer but, when I build my project in Android Studio, I get the following error:

error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;

and

error: cannot find symbol
public class Provider extends FileProvider {
                              ^
  symbol: class FileProvider

Note: it's a capacitor project with:

capacitor:2.4.7

@ionic-native/email-composer:5.36.0

cordova-plugin-email-composer:0.9.2

ionic:6.17.1

Any ideas?

Upvotes: 2

Views: 2061

Answers (1)

jcesarmobile
jcesarmobile

Reputation: 53301

Capacitor uses AndroidX dependencies, while some plugins still use the deprecated android support dependencies. You can use jetifier to patch the packages, see the troubleshooting guide.

npm install jetifier
npx jetify
npx cap sync android

https://capacitorjs.com/docs/android/troubleshooting#error-package-androidsupport-does-not-exist

Upvotes: 1

Related Questions