You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am creating an App with Ionic and Capacitor, using also some Cordova Plugins.
In our old App (only Cordova, no Capacitor) we had an own implemented mechanism: We put the web-part of the application on a server to deliver it. When starting the App, we check on the server if we have the correct version.
If we are on an old version, we redirect (via window.location.replace) to the web-part which is included on the server.
Therefore we used the "www"-directory from the generated folder in platforms/android/app/src/main/assets.
Everything works great. We are always having the correct web-part and can use the Cordova-Hardware-Plugins.
In the new App with Capacitor, I wanted to use the same mechanism. I also put the folder android/app/src/main/assets/public/ on the server and open the server-url, if we have an old version. This also works in browsers without any problems. But when I use an Android-Device, I can not access the Cordova-Hardware-Plugins. I am getting "cordova is not available", even if I am still in the Capacitor-Cordova-App. I just redirect from http://localhost to the server-url. The same problem occurs, if I try remote debugging with "ionic serve".
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am creating an App with Ionic and Capacitor, using also some Cordova Plugins.
In our old App (only Cordova, no Capacitor) we had an own implemented mechanism: We put the web-part of the application on a server to deliver it. When starting the App, we check on the server if we have the correct version.
If we are on an old version, we redirect (via window.location.replace) to the web-part which is included on the server.
Therefore we used the "www"-directory from the generated folder in platforms/android/app/src/main/assets.
Everything works great. We are always having the correct web-part and can use the Cordova-Hardware-Plugins.
In the new App with Capacitor, I wanted to use the same mechanism. I also put the folder android/app/src/main/assets/public/ on the server and open the server-url, if we have an old version. This also works in browsers without any problems. But when I use an Android-Device, I can not access the Cordova-Hardware-Plugins. I am getting "cordova is not available", even if I am still in the Capacitor-Cordova-App. I just redirect from http://localhost to the server-url. The same problem occurs, if I try remote debugging with "ionic serve".
Does anybody have a suggestion how to solve this?
Beta Was this translation helpful? Give feedback.
All reactions