question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: “error: package android.support.v4.content does not exist”

See original GitHub issue

Bug Report

Capacitor Version

2.0.1

npx cap doctor output:

Affected Platform(s)

  • Android
  • iOS
  • Electron
  • Web

Current Behavior

error: package android.support.v4.content does not exist

Expected Behavior

https://ionicframework.com/docs/native/camera

Sample Code or Sample Application Repo

https://github.com/Hansel03/photoApp

Reproduction Steps

ionic build ionic capacitor add android ionic capacitor open android

Other Technical Details

npm --version output: 6.13.4

node --version output: v12.16.1

pod --version output (iOS issues only): 1.9.1

ionic/angular 5.0.0

Android Studio 3.6.3 Captura de Pantalla 2020-04-22 a la(s) 4 38 15 p  m

Other Information

https://github.com/ionic-team/capacitor/issues/1663

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

163reactions
deborahjamescommented, Apr 7, 2021

Thank you so much . was getting error :

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

using jetify helped to solve .

from jcesarmobile’ s post — >https://github.com/ionic-team/capacitor/pull/2832

Error: “package android.support.* does not exist”

This error occurs when some Cordova or Capacitor plugin has old android support dependencies instead of using the new AndroidX equivalent. You should report the issue in the plugin repository so the maintainers can update the plugin to use AndroidX dependencies.

As workaround you can also patch the plugin using jetifier

npm install jetifier
npx jetify
npx cap sync android
3reactions
jcesarmobilecommented, Apr 27, 2020

This is a problem on plugins not using old android support dependencies instead of AndroidX equivalent. Capacitor 2 requires AndroidX dependencies. It’s documented on the migration guide, but since some people can face this in new apps that are not migrated from Capacitor 1, I’ve added some information about it on the android troubleshooting guide

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android "error: package android.support.v4.content does not ...
Ionic + Fastlane | Android "error: package android.support.v4.content does not exist" · 2. I am not an expert in Fastlane for Android or...
Read more >
Moodle in English: Struggling to build
... error: package android.support.v4.content does not exist public class FileProvider extends android.support.v4.content.FileProvider {
Read more >
error: package android.support.v4.content does not exist
error: package android.support.v4.content does not exist. Add Answer | View In TPC Matrix. Technical Problem Cluster First Answered On November 16, ...
Read more >
error: package android.support.v4.content does not exist
error: package android.support.v4.content does not exist ... If you have already import appcompat_v7 but still the problem doesn't solve. then try it.
Read more >
task :capacitor-cordova-android-plugins ... - You.com
... error: package android.support.v4.content does not exist public class FileProvider extends ... Please help me to fix this problem. Thank you.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found