我有一个带有电容器的ionic 5项目,当我尝试打开pouchdb数据库时:
let pdb = new PouchDB('msg.db', {
adapter: 'cordova-sqlite',
location: 'default',
revs_limit: 1,
auto_compaction: true
});
失败,日志如下:
pouchdb:adapter Picked adapter: +0ms cordova-sqlite
my-groups:6463 OPEN database: msg.db
my-groups:6394 new transaction is queued, waiting for open operation to finish
my-groups:6485 OPEN database: msg.db FAILED, aborting any pending transactions
my-groups:6371 Could not open database
index-browser.es.js:451 WebSQL threw an error Error: Invalid database handle
at newSQLError (my-groups:6314:18)
at SQLitePlugin.abortAllPendingTransactions (my-groups:6446:23)
at my-groups:6490:17
at Object.callbackFromNative (my-groups:1224:46)
at <anonymous>:1:9
at DbService.createPouchDB (db.service.ts:40:5)
at new PchatService (pchat.service.ts:43:33)
at Object.PchatService_Factory [as factory] (ɵfac.js? [sm]:1:1)
at R3Injector.hydrate (core.js:11452:1)
at R3Injector.get (core.js:11272:1)
它发生在安卓12上(可能也发生在11上),但不在安卓10上。
知道怎么修吗?