Questions tagged [capacitor]

Capacitor is a cross-platform app runtime that allows developers to build web apps that run natively on iOS, Android, Electron and the web.

Capacitor is being designed by the Ionic Framework team as an eventual alternative to Cordova, though backwards compatibility with Cordova plugins is a priority and is actively being worked on. Capacitor can be used without Ionic Framework, but soon it'll become a core part of the Ionic developer experience.

Capacitor also comes with a Plugin API for building native plugins. On iOS, first-class Swift support is available, and much of the iOS Capacitor runtime is written in Swift. Plugins may also be written in Objective-C. On Android, support for writing plugins with Java and Kotlin is supported.

Related links

Related tags

2145 questions
41
votes
7 answers

Error occurred while copying resources/android/icon/mdpi-foreground.png

I am getting following error while copying icons and splash screen using cordova-res. I am using capacitor to build the app I am using following command to copy the icons: cordova-res android --skip-config --copy here is the response of the…
Hello World
  • 2,673
  • 7
  • 28
  • 60
41
votes
8 answers

capacitor.settings.gradle' as it does not exist

I am new to Ionic while build the app in android. Its opening a project in Android Studio but while gradle sync its showing the following error Could not read script…
Jose Vazhappilly
  • 511
  • 1
  • 4
  • 3
32
votes
8 answers

How can I determine if the current platform is a native app or web in Capacitor?

In Cordova you had immediate access to process.env.CORDOVA_PLATFORM is there something similar in Capacitor? I'm looking to conditionally load some functions on startup and don’t want to block rendering waiting for async Device.getInfo to come…
Titan
  • 5,567
  • 9
  • 55
  • 90
28
votes
4 answers

How do you update the iOS & Android app version in Ionic w/ Capacitor?

I am developing an app using Ionic and Capacitor. Builds are generated using Ionic's new AppFlow service, so I don't build them locally. How do I go about updating the iOS and Android version numbers? I've tried updating the plist and config.xml,…
Bryant Makes Programs
  • 1,493
  • 2
  • 17
  • 39
27
votes
7 answers

Ionic invalid package name __ngcc_entry_points__.json

I'm almost finished developing my application with ionic and angular. Unfortunately, I'm totally stuck. I can't build my application (on android) anymore. Here's the error: ionic cordova build android cordova.cmd platform add android --save Using…
VeeN
  • 479
  • 1
  • 5
  • 14
25
votes
1 answer

src/zone-flags.ts is missing from the TypeScript compilation after upgrading to Ionic 5, or capacitor 5

I upgraded my Ionic 4 application by these two commands: # Upgrading to Ionic 5 npm install @ionic/angular@latest @ionic/angular-toolkit@latest --save # Upgrading to Angular 9 ng update @angular/core @angular/cli And when I did ionic serve, I…
Shashank Agrawal
  • 25,161
  • 11
  • 89
  • 121
21
votes
1 answer

npx cap sync vs npx cap copy

I am new to the capacitor and developing an application where I am making changes into code and running ionic build npx cap copy npx cap open android And it is also recommended to use npx cap sync in behalf of npx cap copy. What is the exactly…
Neha Shah
  • 1,147
  • 6
  • 14
21
votes
7 answers

Unable to add a source with url `https://cdn.cocoapods.org/` named `trunk`

I'm building an app with capacitor for ios. When I launch the command 'npx cap sync ios' (which launch pod install) and I get this error : ✖ Updating iOS native dependencies with "pod install" (may take several minutes): ✖ update ios: [error]…
Damien Romito
  • 9,801
  • 13
  • 66
  • 84
20
votes
6 answers

" npx cap add ios" fails with error "Updating iOS native dependencies with pod install - failed!"

I just created a brand new Ionic app, using command "ionic start myApp blank" I added the necessary angular dependencies to get "ionic serve" working properly. I have installed capacitor using the following commands npm install @capacitor/cli…
kathikeyan A
  • 1,668
  • 2
  • 16
  • 31
19
votes
3 answers

Hybrid JavaScript Mobile Development - Apache Cordova vs Capacitor with Ionic vs NativeScript vs React Native

First of all, hope so this question is not too broad. Coming from front-end background I'm thinking to start learning one of JavaScript-related frameworks for mobile development. And here comes the first question, shall I go with Apache Cordova or…
17
votes
9 answers

Capacitor 3.0 Upgrade Plugins "not implemented" Exception (Nx Monorepo)

We use Angular in a nx monorepo in which we have been using Capacitor 2.4 for half a year now. We only use the android platform as of now. Now, we need to upgrade to Capacitor 3.0. The app itself is running again, however, as soon as I use any…
irispoe
  • 191
  • 1
  • 1
  • 6
17
votes
1 answer

Using a Cordova plugin with Capacitor

I've been working through this example: https://capacitor.ionicframework.com/docs/basics/cordova I've run: npm install cordova-plugin-qrscanner npx cap sync and I can see the plugin installed in my node_modules. What I do not know how to do is…
Tony J Watson
  • 629
  • 2
  • 9
  • 20
16
votes
3 answers

`.gitignore` for an Ionic project with Android target

I'm creating an Ionic project using Capacitor (edit: the newer recommended framework compared to Cordova) and added Android as a target. I've been able to build the app and add the Android target, which creates a bucketload of files under android/,…
LightCC
  • 9,804
  • 5
  • 52
  • 92
16
votes
4 answers

Capacitor/Ionic: Handling push notification in background or when app was killed

Goodmorning everyone, I haven't been able to find a solution for several hours now. I use the "PushNotifications" Capacitor plugin (https://capacitor.ionicframework.com/docs/apis/push-notifications/) to listen to push notifications that come to me…
Lorenzo Iovino
  • 204
  • 2
  • 5
16
votes
2 answers

ERROR: Unable to find module with Gradle path ':capacitor-cordova-android-plugins'

I'm developing a mobile app with Ionic 4, Capacitor and some Cordova plugins and have run into a problem when attempting to run the app on Android. Android Studio refuses to run the project and prints the following error: ERROR: Unable to find…
mkkekkonen
  • 1,704
  • 2
  • 18
  • 35
1
2 3
99 100