Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230117

Capacitor 4: package android.content does not exist import android.content.Context

$
0
0

I’m running into this exact same issue. The errors are happening in the capacitor-android module itself. I upgraded “manually”, by updating all @capacitor-related dependencies.

For me, the issue was that I overlooked the @capacitor/cli dependency. After I updated that dependency to ~4.2.0, and then deleted the /android folder (rm -rf android), and re-added it (npx cap add android) it works!

Current capacitor dependencies for my project:

"dependencies": {
    //...
    "@capacitor/android": "~4.2.0",
    "@capacitor/app": "~4.0.1",
    "@capacitor/browser": "~4.0.1",
    "@capacitor/core": "~4.2.0",
    "@capacitor/haptics": "~4.0.1",
    "@capacitor/ios": "~4.2.0",
    "@capacitor/keyboard": "~4.0.1",
    "@capacitor/status-bar": "~4.0.1"
   // ...
},
  "devDependencies": {
       // ...
    "@capacitor/cli": "4.2.0",
    "@ionic/angular-toolkit": "^7.0.0",
    "@ionic/cli": "^6.20.1",
}

Viewing all articles
Browse latest Browse all 230117

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>