SQLite not working on Android

#1

I’m testing Expo’s SQLite lib on an Android simulator (Genymotion).

I create a table as shown in the example app

db.transaction(tx => {
  tx.executeSql(
    'create table if not exists items (id integer primary key not null, done int, value text);'
  );
});

in componentDidMount().

But apparently this code prevents both componentDidMount() and componentWillMount() being executed? I have a log at the beginning of both of these methods and it doesn’t display anything unless I comment the transaction. Also, the device is blank and there are no any logs / error messages.

I tried also this version, to see if it outputs anything:

db.transaction(tx => {
  tx.executeSql(
    'create table if not exists items (id integer primary key not null, name text);',
    [],
    () => console.log("Created table"), () => console.log("Error"))
})

But still nothing. Everything just stops working, silently. Any ideas? And is it possible to somehow debug this?

closed #2

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.