Using Phonegap Build plugin: exec() call to unknown plugin: SQLitePlugin

41 views
Skip to first unread message

Bob Templeton

unread,
Aug 30, 2014, 4:09:06 PM8/30/14
to Cordova-SQ...@googlegroups.com
I am not using a local build environment such as Eclipse.  I simply have a folder with a file structure according to PhoneGap Build's docs.  I'm using Brackets for editing, uploading, and building through PGB.

Okay, I've got the following tag in my config.xml:
<gap:plugin name="com.brodysoft.sqliteplugin" version="1.0.0" />

In my onDeviceReady I have:
var db = window.sqlitePlugin.openDatabase({name: "RCFlightLog.sqlite"});

Logcat returns:
D/CordovaLog(14654):  file:///data/data/com.t3chdad.basic/hydra_app/plugins/com.brodysoft.sqlitePlugin/www/SQLitePlugin.js: Line 39 : SQLitePlugin openargs: {"name":"RCFlightLog.sqlite"}
I/Web Console(14654):  SQLitePlugin openargs: {"name":"RCFlightLog.sqlite"}:39
D/PluginManager(14654):  exec() call to unknown plugin: SQLitePlugin


Can you offer any insight?  Thank you.

Chris Brody

unread,
Aug 30, 2014, 11:13:42 PM8/30/14
to Bob Templeton, Cordova-SQ...@googlegroups.com
If I am not mistaken the plugin element was deprecated and is no
longer supported in 3.x. You have to add to feature instead.

Chris
> --
> You received this message because you are subscribed to the Google Groups
> "Cordova-SQLitePlugin" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to Cordova-SQLitePl...@googlegroups.com.
> To post to this group, send email to Cordova-SQ...@googlegroups.com.
> Visit this group at http://groups.google.com/group/Cordova-SQLitePlugin.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/Cordova-SQLitePlugin/60ccef6f-97b3-4eb5-b007-fe67446e4851%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Bob Templeton

unread,
Aug 31, 2014, 9:02:02 AM8/31/14
to Cordova-SQ...@googlegroups.com, t3c...@gmail.com
So I put this in my config.xml instead of the plugin element:
    <feature name="SQLitePlugin">
        <param name="android-package" value="com.brodysoft.sqliteplugin" />
    </feature>   


No difference in logcat:
D/CordovaLog(24133):  file:///data/data/com.t3chdad.basic/hydra_app/plugins/com.brodysoft.sqlitePlugin/www/SQLitePlugin.js: Line 39 : SQLitePlugin openargs: {"name":"RCFlightLog.sqlite"}
I/Web Console(24133):  SQLitePlugin openargs: {"name":"RCFlightLog.sqlite"}:39
D/CordovaLog(24133):  file:///data/data/com.t3chdad.basic/hydra_app/plugins/com.brodysoft.sqlitePlugin/www/SQLitePlugin.js: Line 52 : undefined
I/Web Console(24133):  undefined:52
D/PluginManager(24133):  exec() call to unknown plugin: SQLitePlugin

   
All the 3.5.0 docs still refer to the plugin tag as well as all the individual plugin pages.  When I look in the built apk, it doesn't look like the native code (.java, .h, .m, etc) is being injected during the build.

Bob Templeton

unread,
Aug 31, 2014, 9:25:52 AM8/31/14
to Cordova-SQ...@googlegroups.com, t3c...@gmail.com
After more testing, it looks like the plugin element/tag is required or the app plugin page shows "no plugins"

Bob Templeton

unread,
Sep 1, 2014, 8:23:14 AM9/1/14
to Cordova-SQ...@googlegroups.com, t3c...@gmail.com
Progress...It seems as though either phonegap build or Brackets with the phonegap plugin was not uploading and building my project properly.  I'm not getting any errors at all now and I know it's working sort-of.  I opens the db or creates the DB as it should. However, no data is returned or written during querys. I even cut and pasted the example code from your docs page.  It runs fine, db gets created but data isn't written or read from it and there are no errors whatsoever.

Bob Templeton

unread,
Sep 1, 2014, 9:40:48 AM9/1/14
to Cordova-SQ...@googlegroups.com, t3c...@gmail.com
It seems as though I'm not the only one having problems with this.

https://muut.com/i/appgyver/steroids-build-service:sqlite-plugin-removed

Chris Brody

unread,
Sep 1, 2014, 10:09:07 AM9/1/14
to Bob Templeton, Cordova-SQ...@googlegroups.com
Here is the config.xml that I get when I create a fresh Cordova project, add the Android platform, and then add the sqlite plugin:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.bb" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <preference name="loglevel" value="DEBUG" />
    <preference name="AndroidLaunchMode" value="singleTop" />
    <feature name="App">
        <param name="android-package" value="org.apache.cordova.App" />
    </feature>
    <name>cc</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="d...@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <access origin="*" />
    <feature name="SQLitePlugin">
        <param name="android-package" value="org.pgsqlite.SQLitePlugin" />
    </feature>
</widget>



--
You received this message because you are subscribed to the Google Groups "Cordova-SQLitePlugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Cordova-SQLitePl...@googlegroups.com.
To post to this group, send email to Cordova-SQ...@googlegroups.com.
Visit this group at http://groups.google.com/group/Cordova-SQLitePlugin.

Bob Templeton

unread,
Sep 2, 2014, 9:09:23 AM9/2/14
to Cordova-SQ...@googlegroups.com, t3c...@gmail.com
"Here is the config.xml that I get when I create a fresh Cordova project, add the Android platform, and then add the sqlite plugin..."

That's in a local dev environment...right?  That's not what I'm doing...I don't have node.js, cordova, android sdk, ant or anything like that on my machine. All I have is my www with my html, js and css directory that I'm uploading to PGB for building and I am including the sqlitePlugin in my config.xml as stated in the PhoneGap docs (https://build.phonegap.com/plugins/977).  Is it possible to use the plugin in this manner or do I need to have a local dev and build environment with the native sdk's etc.?

Thank you for your help and patience.
To unsubscribe from this group and stop receiving emails from it, send an email to Cordova-SQLitePlugin+unsub...@googlegroups.com.

To post to this group, send email to Cordova-SQ...@googlegroups.com.
Visit this group at http://groups.google.com/group/Cordova-SQLitePlugin.

Chris Brody

unread,
Sep 2, 2014, 9:13:47 AM9/2/14
to Bob Templeton, Cordova-SQ...@googlegroups.com
I suggest you ask this to the PhoneGap build forum. I can also try it sometime later this week.

Chris


To unsubscribe from this group and stop receiving emails from it, send an email to Cordova-SQLitePl...@googlegroups.com.

To post to this group, send email to Cordova-SQ...@googlegroups.com.
Visit this group at http://groups.google.com/group/Cordova-SQLitePlugin.

Bob Templeton

unread,
Sep 3, 2014, 9:20:04 AM9/3/14
to Cordova-SQ...@googlegroups.com, t3c...@gmail.com
Thanks for the feedback.  I will do that.  I appreciate your time.
To unsubscribe from this group and stop receiving emails from it, send an email to Cordova-SQLitePlugin+unsubscrib...@googlegroups.com.
To post to this group, send email to Cordova-SQ...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Cordova-SQLitePlugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Cordova-SQLitePlugin+unsub...@googlegroups.com.
To post to this group, send email to Cordova-SQ...@googlegroups.com.
Visit this group at http://groups.google.com/group/Cordova-SQLitePlugin.

Bob Templeton

unread,
Sep 3, 2014, 8:05:30 PM9/3/14
to Cordova-SQ...@googlegroups.com, t3c...@gmail.com
Nothing on the build forums specifically. 

However, I did finally by chance/accident discover what the problem is...Hydration.  PhoneGap Build's Hydration feature breaks
com.brodysoft.sqliteplugin on iOS, Android, and WP8.  It is easily reproducible.  You can cut and paste your simple example code listed in the README.MD into an index.html, add the plugin in the config.xml with the <gap:plugin> tag and it will work if hydration is disabled on your PGB app.  If you then enable hydration and reinstall the app as directed by the docs and allow it to "update", it will not work anymore.  When this issue occurs, the db object created from window.sqlitePlugin.opendatabase({name: "my.db"}) is valid, but none of the methods for this object work.  No errors or exceptions are returned, it's just like the code block for the db.xxxxx doesn't even execute. 

I do really appreciate your patience in dealing with me and your offered suggestions.  Once you validate this, you may wish to add a notice.  One thing I did find out on the PGB forums is that Hydration seems to break quite a few plugins...at least there are many posts on the subject.

Thanks again!

Chris Brody

unread,
Sep 3, 2014, 8:46:50 PM9/3/14
to Bob Templeton, Cordova-SQ...@googlegroups.com
> is...Hydration. PhoneGap Build's Hydration feature breaks
> com.brodysoft.sqliteplugin on iOS, Android, and WP8. It is easily

I just filed https://github.com/brodysoft/Cordova-SQLitePlugin/issues/130
to document this limitation. I am extremely grateful, I am sure it
will help others down the road.

> I do really appreciate your patience in dealing with me and your offered
> suggestions. Once you validate this, you may wish to add a notice. One

Will do!

> thing I did find out on the PGB forums is that Hydration seems to break
> quite a few plugins...at least there are many posts on the subject.

Seems to me like they don't really deal with the problem.

I will rant a little here. It took quite a while to get the plugin
approved, even though a couple others were already accepted and had
gone out-of-date. Meanwhile a few issues, mostly with the WP(8)
version have been solved. I am debating when to submit the next update
to PG Build.

> Thanks again!

Happy that you can (finally) use the plugin.

Chris
Reply all
Reply to author
Forward
0 new messages