CameraLauncher.java:40: error: package android.support.v4.content does not exist

Hi! I have this error when I try to build for Android with Ionic Package:

/android/capacitor-cordova-android-plugins/src/main/java/org/apache/cordova/camera/CameraLauncher.java:40: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;

It seems it’s because Camera plugin uses AndroidX, but I am not able to find how to fix the issue! :frowning:

I have no problems when I run ionic cordova build android --prod

What should I do?
Thanks!

1 Like

Hi, Did you find a solution?

Capacitor uses AndroidX dependencies, and some plugins (like cordova-plugin-camera) still use old android support libraries and Android don’t allow to use both on the same project.

If some plugin still uses android support libraries you can patch it with jetifier, see

2 Likes