tekartik / sqflite

SQLite flutter plugin
BSD 2-Clause "Simplified" License
2.86k stars 521 forks source link

sqflite iOS can't save out of application directory #1085

Open mrwill84 opened 7 months ago

mrwill84 commented 7 months ago

Hi Guys this's the greatest sqlite lib I used in flutter . much appreciated for hard work. I'm not sure and search all the possible on internal ,can't find the proper solution . I'm perparing to do a database viewer in iOS, and I want to create a db file out of application . I tried to open db file ( in doc or out of doc ) it works likes charming . but can't create in my real iOS phone ( simulation also work well ) any suggestion here ? any ideas I loves ?

Error stack :

[logging-persist] cannot open file at line 46922 of [6bf7a27121]
[logging-persist] os_unix.c:46922: (0) open(/private/var/mobile/Containers/Shared/AppGroup/1F81A1A0-68F8-4EEE-B25B-E621712F446C/File Provider Storage/test/sqlite1.db) - Undefined error: 0
error opening!: 14
Could not create database queue for path /private/var/mobile/Containers/Shared/AppGroup/1F81A1A0-68F8-4EEE-B25B-E621712F446C/File Provider Storage/test/sqlite1.db
Could not open db.
flutter: DatabaseException(open_failed /private/var/mobile/Containers/Shared/AppGroup/1F81A1A0-68F8-4EEE-B25B-E621712F446C/File Provider Storage/test/sqlite1.db)
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
#0      DBHelper.getTbls (package:flutter_pandas/db/dbhelp.dart:77:14)
#1      Tables.build.<anonymous closure> (package:flutter_pandas/ui/Tables.dart:26:33)
#2      HomePage.build.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:flutter_pandas/ui/pages/Home.dart:136:58)
<asynchronous suspension>
alextekartik commented 7 months ago

You seem to have a null check error here (hard to say without seeing the code):

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
#0      DBHelper.getTbls (package:flutter_pandas/db/dbhelp.dart:77:14)