I followed this tutorial: https://devdactic.com/ionic-4-sqlite-queries/
I have a problem with the sqlitePorter plugin when I run this command on Visual Studio Code :
ionic serve --devapp
The application starts correctly on my mobile, but the following error suddenly appears in my console:
console.warn: Install the SQLitePorter plugin: ‘ionic cordova plugin add uk.co.workingedge.cordova.plugin.sqliteporter’
console.error: [plugin_not_installed error]
I do not really understand what happens because when I do “ionic cordova plugin ls”, the plugin is present.
Does anyone have an idea of what might be going on, and how can I fix that?
Thank you in advance
Ionic DevApp only supports a selective set of native plugins of which this plugin is not one of them.
If you wish to use this plugin, you need to do a full native build app using Ionic/Cordova.
For More Info: https://github.com/dpa99c/cordova-sqlite-porter/issues/42
Related
In this tutorial to use SQLite with PouchDB, the cordova plugin used is cordova-plugin-sqlite-2. Meanwhile in another tutorial to use SQLite in Ionic, the cordova plugin used is cordova-sqlite-storage.
What's actually the difference between the two plugins?
Is it possible to use cordova-sqlite-storage with PouchDB instead of cordova-plugin-sqlite-2 ?
And is it possible to use cordova-sqlite-plugin-2 when I want to work with Ionic 5 Native SQLite plugin (as the 2nd tutorial)?
UPDATE:
I tried creating an app that uses PouchDB and I installed cordova-sqlite-storage plugin instead of cordova-plugin-sqlite-2 because I want to use Ionic Native SQLite at the same time. When the app launches, I get an error as below:
ERROR Error: Uncaught (in promise): {"status":500,"name":"web_sql_went_bad","message":"unknown","reason":"Invalid database handle"}
at resolvePromise (zone-evergreen.js:797:1)
at resolvePromise (zone-evergreen.js:754:1)
at zone-evergreen.js:858:1
at ZoneDelegate.invokeTask (zone-evergreen.js:391:1)
at Object.onInvokeTask (core.js:34182:1)
at ZoneDelegate.invokeTask (zone-evergreen.js:390:1)
at Zone.runTask (zone-evergreen.js:168:1)
I have also installed pouchdb-adapter-cordova-sqlite in my project. According to pouchdb-adapter-cordova-sqlite, it should work with cordova-sqlite-storage as well as stated;
PouchDB adapter using native Cordova SQLite as its backing store. It
works with any one of the following Cordova plugins:
Cordova-sqlite-storage
cordova-plugin-sqlite-2
cordova-plugin-websql
Why did I get that error when I switched to using cordova-sqlite-storage?
Make sure to have only ONE of the plugins.
The error that I got seems to be caused by both plugins existing inside the package.json. I thought I've removed it by using the ionic cordova plugin rm cordova-plugin-sqlite-2 but when I removed and added the platform again, and run ionic cordova run android -l, the error still showed up and inside the package.json, apparently cordova-plugin-sqlite-2 was still available.
Checked inside the config.xml and removed it from there, removed and added the platform, error disappeared.
I have a problem...
I'm try to add this plugin: https://github.com/danwilson/google-analytics-plugin.
I'm develop an application with: AngularJS, Ionic and Mobile First Platform 7.1(MFP), in this version of MFP I must add the plugin manually.
iOS works fine.
My problem is Android:
Error: "The import com.google.android cannot be resolved".
I download Google Play Services with SDK but the problem continues...
Any idea to solve this problem?
Regards.
This other plugin https://github.com/appfeel/analytics-google uses gradle dependencies which should solve this problem.
Other option could be to remove google play dependency from the plugin you mentioned and manually modify gradle (actually I don't recommend this option as gradle gets generated automatically each time you remove/add the platform).
Other option is to modify the plugin itself (maybe a github fork). Here you can see what should it be modified: https://github.com/appfeel/analytics-google/pull/11/files
Following the guidelines here: http://docs.ionic.io/docs/push-from-scratch I am having trouble with step 2 - installing ionic add ionic-platform-web-client.
My index file within my app adds <script src="lib/ionic-platform-web-client/dist/ionic.io.bundle.min.js"></script> as it should, however the file doesn't exist at this location, even after running 'ionic lib update'.
(For ease of explanation in this section I am using the non minified version of the bundle: ionic.io.bundle.js (the results are the same with both full and minified versions of the files)).
Manually adding ionic.io.bundle.js from https://github.com/driftyco/ionic-platform-web-client/tree/master/dist will give me this error:
"Uncaught TypeError: Cannot call method 'get' of undefined
ionic.io.bundle.js (3429,0)"
from this code:
key: "get",
value: function get(name) {
return this._settings.get(name);
}
I found a 'hacky' way to get the dev pushes working by simply returning this instead of the full return this._settings.get(name) statement, although this only really suits the purpose of debugging and additionally does not allow removal of developer mode by settings 'ionic config set dev_push false' or manually setting "dev_push":false in .io-config.json.
I am unsure as to whether manually adding ionic.io.bundle.js is simply adding to my problems or whether this is the right approach to take and that the errors produced are the real problem?
I am running:
ionic 1.1.0
ionic CLI 1.7.7,
cordova 5.3.3,
bower 1.6.2,
npm 2.11.3,
visual studio 2015 community with cordova/ionic setup,
I've also updated my android platform - for which I am currently building to (deploying to nexus 7).
TheCannot call method 'get' of undefined in ionic.io.bundle.js happens because of missing settings in the bundle.
This could be fixed by running:
ionic config build
Although I still haven't been able to install the ionic web platform via 'ionic add ionic-platform-web-client' in the cli I have managed to get the ionic push notifications working.
Firstly I made sure in my app directory within the cli to use 'ionic lib update'. As the setup of my project was different (thanks to visual studio). You will likely already have these files using a custom setup, but I found it's good to have the directories in place.
Secondly I manually downloaded the web client https://github.com/driftyco/ionic-platform-web-client4 not just the ionic.io.bundle.min.js which seemed to fix my "Uncaught TypeError: Cannot call method 'get' of undefined" problem mentioned previously, after I moved the entirety of this in my lib directory. (Make sure the name of the downloaded folder matches: "ionic-platform-web-client" exactly, and doesn't contain any words like master).
Thirdly, as I couldn't add version 1.3.0 of the push plugin (which continually gave me the beloved 'uh oh' error) I used 1.2.3 instead. I installed this via: 'cordova plugin add https://github.com/phonegap/phonegap-plugin-push.git#1.2.31'. Although I have just noticed 1.4.0 is available which may also work?
This should hopefully fix any issues you have, even if it's not a perfect solution. As a side note: I know it is mentioned somewhere on one of the ionic pages that you need to have a traditional project setup and then move the relevant files but it would be nice to have some description of how to go about this - as you may not know what the relevant files are. For anyone who comes here scratching their heads, If you're using visual studio to create your ionic projects from scratch or any other custom setup, you will likely run into the same issues, as the relevant directories created using 'ionic start myApp' will likely have been omitted.
I am attempting to lock the orientation of the meteor cordova build to portrait mode.
I have set up a top-level file called mobile-config.js
In that file I included:
App.setPreference('Orientation', 'portrait');
This seems to have no effect, it still switches to landscape mode.
Does anyone know how I could implement portrait lock? Thanks!
It appears to be an open bug, check this answer here and the bug itself here.
Apparently the simplest way is to edit the Manifest.xml file directly (what comes out of the meteor build command), but I'd use a plugin to avoid having to edit files manually after each build.
Bottom line, to fix it, wait for an official bug fix or meanwhile use a plugin.
Not sure if you have fixed it yet. I had a similar issue and resolved it for android app. Please note this solution has been tested for Meteor running on android device using:meteor run android-device. Meteor version is 1.3, also works on 1.3.1. Just stop your meteor server, uninstall the app from android device. Then inside the meteor project directory, meteor reset. Then meteor run android-device.
Let me know if this helps.
I'm using cordova 3.4.0 and the sqlite plugin (https://github.com/brodysoft/Cordova-SQLitePlugin) to develop an android app with a prepopulated database. I configured the plugin and the database following this post: http://www.corporatezen.com/2012/11/shipping-prepopulated-database-phonegap/
The problem is that the first time the app is launched, it copies the database from the assets folder to the database folder and on old devices with android 2.3.x it can take more than 10 seconds (I have a 90MB database). During this time the screen is black and users may think the app doesn't work and close it.
I tried to look for a faster way to copy the file, but I couldn't find anything.
I tried also to set a splashscreen, using the splascreen plugin (https://github.com/apache/cordova-plugin-splashscreen/blob/dev/doc/index.md) but it appears only after the black screen phase.
Do you have any suggestion?
Solved with this plugin: https://github.com/an-rahulpandey/cordova-plugin-dbcopy
With this, the java code to copy the db is called by the plugin and it's easier to show to the users a warning message created with HTML & Javascript.
I also agree with Sergio.
"dpcopy" is a simple, but a powerful tool.
https://github.com/an-rahulpandey/cordova-plugin-dbcopy
And I also recommend you to apply "Cordova-sqlite-evcore-extbuild-free."
Currently, I'm designing my apps with Cordova, IONIC in Visual Studio 2015 and I applied those two plugins above for prepopulated DB.
The following Git also will solve your question.
https://github.com/ymochi/prepopulated-DB-for-hybrid-applications