Cordova-sqlite-storage: Problem when build android on cordova 6.1

Created on 25 May 2016  路  6Comments  路  Source: storesafe/cordova-sqlite-storage

Hello

I have the bellow problem when build android with cordova
:compileDebugJavaWithJavacC:\wamp\www\test\platforms\android\src\io\liteglue\SQLitePlugin.java:374: error: SQLiteConnection is abstract; cannot be instantiated
mydb = new SQLiteConnection(dbFile);
^
C:\wamp\www\test\platforms\android\src\io\liteglue\SQLitePlugin.java:375: error: cannot find symbol
mydb.open(true); /* create if db does not exist */
^
symbol: method open(boolean)
location: variable mydb of type SQLiteConnection
C:\wamp\www\test\platforms\android\src\io\liteglue\SQLitePlugin.java:433: error: cannot find symbol
long insertId = mydb.getLastInsertId();
^
symbol: method getLastInsertId()
location: variable mydb of type SQLiteConnection
C:\wamp\www\test\platforms\android\src\io\liteglue\SQLitePlugin.java:486: error: cannot find symbol
SQLiteStatement myStatement = mydb.prepare(query);
^
symbol: method prepare(String)
location: variable mydb of type SQLiteConnection
C:\wamp\www\test\platforms\android\src\io\liteglue\SQLitePlugin.java:499: error: cannot find symbol
myStatement.bind(i + 1, paramsAsJson.getDouble(i));
^
symbol: method bind(int,double)
location: variable myStatement of type SQLiteStatement
C:\wamp\www\test\platforms\android\src\io\liteglue\SQLitePlugin.java:501: error: cannot find symbol
myStatement.bind(i + 1, paramsAsJson.getLong(i));
^
symbol: method bind(int,long)
location: variable myStatement of type SQLiteStatement
C:\wamp\www\test\platforms\android\src\io\liteglue\SQLitePlugin.java:503: error: cannot find symbol
myStatement.bind(i + 1, paramsAsJson.getString(i));
^
symbol: method bind(int,String)
location: variable myStatement of type SQLiteStatement
C:\wamp\www\test\platforms\android\src\io\liteglue\SQLitePlugin.java:522: error: cannot find symbol
int colCount = myStatement.columnCount();
^
symbol: method columnCount()
location: variable myStatement of type SQLiteStatement
C:\wamp\www\test\platforms\android\src\io\liteglue\SQLitePlugin.java:531: error: cannot find symbol
switch (myStatement.columnType(i)) {
^
symbol: method columnType(int)
location: variable myStatement of type SQLiteStatement
C:\wamp\www\test\platforms\android\src\io\liteglue\SQLitePlugin.java:531: error: strings in switch are not supported in -source 1.6
switch (myStatement.columnType(i)) {
^
(use -source 7 or higher to enable strings in switch)
C:\wamp\www\test\platforms\android\src\io\liteglue\SQLitePlugin.java:537: error: cannot find symbol
row.put(key, myStatement.columnDouble(i));
^
symbol: method columnDouble(int)
location: variable myStatement of type SQLiteStatement
C:\wamp\www\test\platforms\android\src\io\liteglue\SQLitePlugin.java:541: error: cannot find symbol
row.put(key, myStatement.columnLong(i));
^
symbol: method columnLong(int)
location: variable myStatement of type SQLiteStatement
C:\wamp\www\test\platforms\android\src\io\liteglue\SQLitePlugin.java:547: error: cannot find symbol
row.put(key, myStatement.columnString(i));
^
symbol: method columnString(int)
location: variable myStatement of type SQLiteStatement
FAILED

BUILD FAILED

question doc-todo

Most helpful comment

Got my build working, haven't tested the full effect of this yet.

I had both of these installed, but I guess cordova-plugin-sqlite isn't maintained:

cordova-plugin-sqlite
cordova-sqlite-storage

It appears as though _cordova-plugin-sqlite_ implements the SQLiteConnection class as abstract, which conflicts with trying to instantiate it elsewhere.

$ cordova plugin remove cordova-plugin-sqlite

All 6 comments

They issued a Cordova 6.2.0 pretty recently. I recommend that you consider upgrading. Please create a fresh, new project with this plugin and try again.

I have tested this plugin on Cordova 6.1.1 with no problems on Android/iOS/Windows for quite a while. I just tested this plugin with Cordova 6.2.0 on Android with no problems.

I've also got this exact error message with Cordova 6.2.0 on iOS (fresh install).
My Windows version at 6.1.0 builds ok.

Will let you know what I find.

Got my build working, haven't tested the full effect of this yet.

I had both of these installed, but I guess cordova-plugin-sqlite isn't maintained:

cordova-plugin-sqlite
cordova-sqlite-storage

It appears as though _cordova-plugin-sqlite_ implements the SQLiteConnection class as abstract, which conflicts with trying to instantiate it elsewhere.

$ cordova plugin remove cordova-plugin-sqlite

Thanks for reporting. I will document this pitfall when I get a chance.

For unknow reason; on a running build; this issue appears today.
I'm not anymore able to build my project.
I try to install different version of cordova and retry my build without success

I had the same problem after build an old version of the code and later go back to the last one. I removed the platform android and add again, this solved my problem and now works again.

Was this page helpful?
0 / 5 - 0 ratings